[Haskell-beginners] Polymorphism

Ford fordforox at gmail.com
Mon Jul 11 19:24:24 UTC 2016


Hello,

Why exporting a function doesn't force you to make its inputs derive a typeclass? That would solve all name clashing (just derive also or give different name,  because it is obviously too generic). 

Why can't you overload field accessor via typeclass easily? 
data Foo = Foo {HasSize => size :: Int} 
> :t size
HasSize a => size a -> Int

Why is String not deprecated yet,  throwing warning into your face. 

I think that haskell is really missing some uniformity, there is nothing like AbstractString and AbstractArray (something like java Collections) so a lot of modules introduces its own functions that are just aliases for others.  (Even Prelude itself suffers from this - map fmap liftM, pure return...). 

King regards!

Odesláno z BlueMail

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160711/5a5997e4/attachment.html>


More information about the Beginners mailing list