7 ms·
I never enjoyed frontend programming until I came across Elm. Not only that Elm turned out to be a gateway drug to Haskell. Now I write frontend and mobile apps
by sridca 9y ago
I never enjoyed frontend programming until I came across Elm. Not only that Elm turned out to be a gateway drug to Haskell. Now I write frontend and mobile apps in Haskell using Functional Reactive programming (FRP).
- ghayes 9y agoYeah, we've had a great time writing Elm for a fairly complex single-page Ethereum dApp. It's conceptually a lot simpler than Haskell, which made it easy for the team to pick up. I only wish it had a better system (Tasks) for JavaScript interop instead of ports.
- kureikain 9y agoThis is so true. I liked and used Elm when I have the right to make final decision. But it's hard to convince others use Elm when coming to integrate with JS. That's the reason TypeScript won. It intergrate with existing JavaScript seamlessly.
- spraak 9y agoReasonML could be a good middle ground there.
- byw 9y agoOne of the biggest complaints of Elm is the lack of typeclass. I'm not aware of a similar abstraction in OCaml. Does Reason have similar limitations, or are there ways to get around it?
- rs86 9y agoFirst class modules. And yes, not having typeclasses is a bit of a turn off too...
- orbifold 9y agoOCaml has parametrized modules, confusingly called functors, a very nice feature along with first class modules that Haskell doesn’t have. It is roughly speaking used wherever one would use a Typeclass in Haskell http://ocamlgraph.lri.fr/index.en.html http://ocamlgraph.lri.fr/index.en.html is one good example.
- yomly 9y agoNoon question: what is a typeclass in the sense of the feature Elm lacks? Does it mean the equivalent to `class` keyword in the OO sense?
- hawkice 9y agoFrom an OO perspective, Elm lacks interfaces. Typeclasses are probably the best way to handle the idea of interfaces in the functional programming model. Since functions are first class, you can bodge this with an object that has functions in it, but since those don't serialize they don't play well with a lot of Elm idioms if you put them in your model.
- a-saleh 9y agoI thought about this, and kinda came to a conclusion, than I would take a language that has generics, and doesn't have interfaces (i.e. Elm) over a language that has interfaces and doesn't have generics (i.e. Go)
- deboboy 9y agoWhat's your fairly complex dapp about/for?
- crystalPalace 9y agoWhat framework or library are you using to write frontend and mobile apps in Haskell?
- sridca 9y agoReflex http://docs.reflex-frp.org/ http://docs.reflex-frp.org/
- crystalPalace 9y agoThanks for replying! This looks very useful with good documentation and a small but dedicated community. I've worked with Purescript and some other frontend functional languages/frameworks and haven't been as productive as I believe functional allows you to be. But this and Miso seem very promising. I'm really excited about potentially using one language and paradigm for web, mobile, and backend.
- lallysingh 9y agoHolly crap! When did reflex get documentation?!?!