[Haskell-beginners] Type classes and synonyms

Isaac Dupree ml at isaac.cedarswampstudios.org
Sat Nov 21 23:18:22 EST 2009

Sorry to take offense :-) maybe I was being too modest?

What leads me to conclude that is... Reading several papers about uses 
of Arrows and Applicative and Monads for parsing and FRP, being on the 
mailing-lists for a few years listening to debates and people struggling 
with bits of code, getting a sense of the history of each abstraction 
and of how people who use that abstraction daily relate to it.  (let's 
see if I can name names... Ross Paterson, Conor McBride, maybe Simon 
Peyton-Jones..).  Experimenting a bit with my own code.  Having a vague 
sense, through coding Haskell quite a bit, how much it's possible to 
condense a piece of code.  It is not a conclusion of compulsion, just 
that I haven't seen it done better.  It seems Arrows are a necessary 
abstraction for a couple very particular world-views/paradigms, and 
don't fit very well with a lot of other stuff.

So far, I haven't used FRP for anything major, and I've done most 
parsing with Parsec (monad-based) and Happy (hmm, it's a preprocessor). 
  Since I don't have lots of experience with the examples, I didn't want 
to claim to understand the abstraction(class) very well. :-)


Tony Morris wrote:
> If you don't yet understand Arrows, then what compels you to conclude
> that there are more idiomatic solutions (than what you don't yet
> understand)?
> Just sayin'
> Isaac Dupree wrote:
>> Philip Scott wrote:
>>> Thanks John,
>>>> Every module can have its own definition for each name, such as the
>>>>  operator (+).  So in your module (eg. module Main, or module
>>>>  DateValueSeries), you can go ahead and define your own (+).  The major
>>>>  caveat is making sure you don't conflict with the default (+),
>>>> which lives
>>>>  in module Prelude, which is normally automatically brought into scope.
>>> That actually quite nicely solves the problem... it feels almost a
>>> little too easy, after spending the evening getting my mind wrapped
>>> up with Arrows :)
>> why has no one mentioned: you most likely don't need to understand
>> Arrows?  I'm pretty good with Haskell, and Arrows are still somewhat
>> confusing to me.  Why?  Most problems I've worked with in Haskell have
>> had more-idiomatic solutions than Arrows.  (examples include: Monad;
>> Functor; Applicative; just plain functions; plain old lack of
>> type-class abstraction.)  It's not so easy or useful to understand any
>> abstraction/class without using at least two or three useful
>> examples/instances of it first.
>> -Isaac
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners

More information about the Beginners mailing list