[Haskell-cafe] About ($)
Hello there, name's Frank-Andre Riess. Nice to meet you m(_ _)m So, well, my first question on this list is admittedly somewhat simple, but I managed to delay it long enough and now I think I should ask about it: Does ($) have any relevance at all except for being a somewhat handier version of parentheses? Thanks in advance for taking the time to enlighten me. Regards, FAR ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Usage of | in classes
Hi, (B (BGracjan's question led me to another question: (B (B> class Monad m => Ref m r | m -> r where (B> newRef :: a -> m (r a) (B> readRef :: r a -> m a (B> writeRef :: r a -> a -> m () (B (BWhat's the meaning of the bar and the function type in this declaration. I've (Bseen something like that before (with state monads, I think), but couldn't (Bfind an explanation in the Haskell grammar (or anywhere else on haskell.org). (B (BThanks in advance, (BFrank-Andre (B___ (BHaskell-Cafe mailing list (BHaskell-Cafe@haskell.org (Bhttp://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A reference manual for the Haskell monad > functions
> L.S., (B> (B> I have written a reference manual for the most common Haskell monad (B> functions, in the (B> style of "A Tour of the Haskell Prelude". It can be found at: (B> http://members.chello.nl/hjgtuyl/tourdemonad.html (B> (B> (B> Known bug: (B> Not all keywords in the "See also" sections, that could be links, are (B> links. (B (BNice :) (B (BReading over it once, I noticed that you confused the types of (>>) and (>>=). (BDidn't see any other mistake, though. (B (BGreets, (BFrank-Andre Riess (B___ (BHaskell-Cafe mailing list (BHaskell-Cafe@haskell.org (Bhttp://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why distinct tyvars in instance declarations?
Hi there, > but GHC complains: > > Illegal instance declaration for `Foo (Either b b)' > > (The instance type must be of form (T a b c) > > where T is not a synonym, and a,b,c are distinct type variables) > > In the instance declaration for `Foo (Either b b)' unless I'm totally mistaken, your problem isn't the distinction thingy, but rather an error like supplying an Int for where you need (Int -> Int -> Int). That is, you're trying make (Either String String) an instance of Foo, (Either String String) already being a fully constructed type; Foo, on the other hand, seems to require a type constructor that is yet to parameterize over three more types (e.g. StateT). Greets, Frank-Andre Riess ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: haskell parser for java bytecode?
Hi there, keeping out of the previous tiff, I'd just like to mention that I, too, am interested in such a project - I don't require a parser for Java bytecode, but I think I'd be a good experience and at least it would get me to know the JVM a bit better... maybe :) By the way, there once was some discussion about having Haskell actually -target- the JVM (I think, it was on the Glasgow Haskell Users list). That might as well be an interesting thing to do. Best regards, Frank-Andre Riess ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] IO platform for testing
Hi there, > There are some other, minor problems -- for indexing you need ss!!0, the > name m01_mod, and you may need an 'import' to make getArgs visible. yup, and you have to get rid of the two "do"s in the application of putStrLn. Regards, Frank-Andre Riess ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Best way to build strings?
Hello there, > I'm very fond of Python's interpolation approach, where we'd have > something like the following for the External case: > > def __str__(self): > return "(%s [] %s)" % (self.p, self.q) are you familiar with C's printf procedure? It's where that kind of notation comes from. You can use Text.Printf which provides the function printf :: PrintfType r => String -> r Thus you can write show (Prefix l p) = printf "(%s->%s)" l q show (External p q) = printf "(%s [] %s)" p q Alas, I couldn't test it, because the Text module seems to not be installed on my computer (sad thing not being the admin, isn't it?) Nevertheless, take a look at http://www.haskell.org/ghc/docs/latest/html/libraries/base/Text.Printf.html Regards, Frank-Andre Riess ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe