I honestly don't know how to explain it really well, but OCaml is much noisier than Haskell in my opinion. Many times when I see code snippets in OCaml they're not as nice as they look in Haskell, though they're really similar. The small difference seems to snowball when the code gets increasingly complicated.
Compare functor's definitions in either syntax:
module type FUNCTOR = sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
end;;
class Functor where
fmap :: (a -> b) -> f a -> f b
The latter looks cleaner to me. There are other ways you could write it (for example if you turned on explicit forall it would get messier.
At this point I start skipping talks at conferences when they're in Scala because the amount of noise in the syntax is near unbearable to me (and there's likely to be a haskell talk on a similar topic) -- OCaml is much better in that respect, but I still find Haskell's syntax to be easiest on the eyes. OCaml might be more pedantically descriptive though, it seems to be more explicit about everything.
>but OCaml is much noisier than Haskell in my opinion.
I would rather say explicit, and that was a breath of fresh air to me after Haskell. As for your example, how many instances do you need to write all the type classes you need?
In OCaml I could just write all the functions I need in a file, and this file-module would implement all the signatures, thanks to the structural typing, now condiser:
type 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
val apply : ('a -> 'b) t -> 'a t -> 'b t
val map : ('a -> 'b) -> 'a t -> 'b t
val show : 'a t -> ('a -> string) -> string
val return : 'a -> 'a t
instead of
instance Functor a => Functor (Type a) where
fmap :: (a -> b) -> f a -> f b
instance Applicative a => Applicative (Type a) where
<*> :: f (a -> b) -> f a -> f b
instance Show (Type a) where
show :: a -> string
instance Monad...
Compare functor's definitions in either syntax:
The latter looks cleaner to me. There are other ways you could write it (for example if you turned on explicit forall it would get messier.At this point I start skipping talks at conferences when they're in Scala because the amount of noise in the syntax is near unbearable to me (and there's likely to be a haskell talk on a similar topic) -- OCaml is much better in that respect, but I still find Haskell's syntax to be easiest on the eyes. OCaml might be more pedantically descriptive though, it seems to be more explicit about everything.