[Haskell-beginners] (SPAM 3)Re: (SPAM 3)Re: monad and variable result
Damien Mattei
mattei at oca.eu
Mon Dec 10 16:05:29 UTC 2018
thank you, i understand the difference, but can not see a solution,
seems i need main :: IO
so keep code in main, which is not really a problem, but i wanted to
structure it more... i will keep searching a solution, understanding
more haskell
Le 10/12/2018 16:06, Francesco Ariis a écrit :
> On Mon, Dec 10, 2018 at 03:46:46PM +0100, Damien Mattei wrote:
>> query returns a list i suppose because i can wirte this in my main code:
>> bd_rows <- query conn qry_head (Only (name::String))
>
> `query` does not return a `[r]`, rather an `IO [r]`. The difference
> is very important; if you don't get it you will always have troubles
> with Haskell. This will for sure help you
>
> https://www.seas.upenn.edu/~cis194/fall16/lectures/06-io-and-monads.html
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
--
Damien.Mattei at unice.fr, Damien.Mattei at oca.eu, UNS / OCA / CNRS
More information about the Beginners
mailing list