[Haskell-beginners] Signatures

Felipe Lessa felipe.lessa at gmail.com
Wed Jun 23 12:23:44 EDT 2010


On Wed, Jun 23, 2010 at 05:20:16PM +0100, Colin Paul Adams wrote:
> >>>>> "Daniel" == Daniel Fischer <daniel.is.fischer at web.de> writes:
>
>     Daniel> On Wednesday 23 June 2010 18:08:18, Colin Paul Adams wrote:
>     >> >>>>> "Ertugrul" == Ertugrul Soeylemez <es at ertes.de> writes:
>     >>
>     Ertugrul> -- nightmare = unsafePerformIO (getWrongWife >>= sex)
>     >>
>     >> I can't work out the signature for nightmare (in your signature).
>     >>
>     >> :-)
>
>     Daniel> My guess:
>
>     Daniel> getWrongWife :: IO Partner sex :: Partner -> IO Offspring
>
>
> So
>
> nightmare :: Offspring ?


I guess it would be better to have

  sex :: Partner -> IO (Maybe Offspring)

or, if you are lucky/unlucky:

  sex :: Partner -> IO [Offspring]

--
Felipe.


More information about the Beginners mailing list