[Haskell-cafe] difference between type and newtype

Andrea Rossato mailing_list at istitutocolli.org
Sat Aug 26 10:14:59 EDT 2006

Il Sat, Aug 26, 2006 at 02:25:51PM +0100, Brian Hulley ebbe a scrivere:
> runMSO :: MSO a -> State -> (a, State, Output)
> runMSO (MSO f) s = f s

this is exactly what I was looking for!!!!
runMSO (MSO f) s = f s

I've already done the previous part, but I was running it as:
runMSO a = evalMSO a 0

and could not understand where the problem was! I though that the
monad itself was wrong, and not that way I was running it!!

sometimes I feel so stupid!

the fact is that I was thinking that
type MSO a = Int -> (a,Int,String) 
MSO a = MSO (Int -> (a,Int,String)
where the same stuff.
I discovered the hard way that they are not, and it took me almost 2 days!

Thanks a lot for your kind patience.


More information about the Haskell-Cafe mailing list