Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I learned F# as this guy learned Scala. I too dived into Haskell after a while and learnt a lot of new things.

Having learned some great functional tips, I came back to my regular C#/Ruby and applying LINQ and Ruby's blocks seemed more natural to me. However, monads, monoids, functors still don't matter when you switch over.

I've used Yesod to write a small app. A typical form in Yesod (for model binding) has this signature:

newPostForm :: Html -> MForm Blog Blog (FormResult (Text,Text,Text), Widget)

Even after learning Yesod for a while, I wasn't able to completely reason with that signature. Why bother with all the name of the application, sub site, formresult, widget when all you want is just three simple form fields? Rails gives it to you in params[:form]. It's just too easy in Rails with a lot of gems lying around for every task you decide to do. And when you're stuck, you're just a google away from getting your answer.

So my question is: after learning Haskell, do you intend to stick to it? Did I make a wise decision in ditching Haskell?



Comparing a statically typed language to a dynamically typed language is silly when talking about type signatures. Of course you don't have type annotations in Ruby, it's a dynamic language. But it also means you don't get compile-time guarantees.

Ask yourself what would be the type signature of a similar function in another statically typed language. You have a parametrized type with three parameters, which would give you something like:

   MForm<Blog, Blog, SomeFormResultWithWidget>
And SomeFormResultWithWidget would have to be defined elsewhere. I'm not convinced it's clearer than the Haskell version. And you could easily remove the verbosity of the Haskell version with a type alias.


Why not define a type alias?

  type AppForm a = Html -> MForm Blog Blog (FormResult a, Widget)
And then you get:

  newPostForm :: AppForm (Text, Text, Text)


The real fun with type aliases is that GHC rarely uses them in error messages. So you get about 20 lines of type vomit whenever something refuses to compile and then you get to try to piece it back together into a level of abstraction that humans can handle.


Well, it isn't the case here, is it?


>LINQ ... However, monads, monoids, functors still don't matter when you switch over.

Funny that you say that; LINQ is actually implemented using monads.


>I've used Yesod to write a small app

Well, hopefully now you know better.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: