[Haskell-beginners] Combining IO and Either function to "EitherT e IO a"

Brent Yorgey byorgey at seas.upenn.edu
Wed Mar 5 23:31:07 UTC 2014


In Haskell, the term "function" is reserved for things whose types
include an arrow, ->.  IO String has no -> in it, therefore it is not
a function.  Instead we might call it an "action" or a "procedure".

-Brent

On Wed, Mar 05, 2014 at 03:19:48PM -0800, Tim Perry wrote:
> Kim-Ee,
> 
> If I see a function with the signature ":: IO String" I immediately assume
> it is getLine or one of its ilk. Thus the Op's question doesn't seem odd at
> all to me. Could you explicate on why you find this very confusing? After
> all:
> 
> :Prelude> :t getLine
> getLine :: IO String
> 
> I think you know a lot more about Haskell than I do so I'm curious what the
> thinking behind your post was.
> 
> 
> Thanks,
> 
> Tim
> 
> 
> On Wed, Mar 5, 2014 at 10:18 AM, Kim-Ee Yeoh <ky3 at atamo.com> wrote:
> 
> >
> > On Thu, Mar 6, 2014 at 12:49 AM, Nathan Hüsken <nathan.huesken at posteo.de>wrote:
> >
> >> Mmh, I might not have used haskell terminology correctly. Its a function,
> >> in the sense of a function of an imperative language ...
> >
> >
> > Yes, you could model IO String in C as a function taking void and
> > returning a pointer to char.
> >
> > Calling an IO String a Haskell function would confuse a lot of people.
> >
> > -- Kim-Ee
> >
> > _______________________________________________
> > Beginners mailing list
> > Beginners at haskell.org
> > http://www.haskell.org/mailman/listinfo/beginners
> >
> >

> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



More information about the Beginners mailing list