[Haskell-beginners] Type classes and synonyms
Isaac Dupree
ml at isaac.cedarswampstudios.org
Sat Nov 21 17:43:29 EST 2009
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
More information about the Beginners
mailing list