This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-28
Channels
- # beginners (226)
- # boot (18)
- # bristol-clojurians (4)
- # cider (1)
- # clara (77)
- # cljs-dev (79)
- # cljsjs (27)
- # clojure (178)
- # clojure-austin (9)
- # clojure-dev (30)
- # clojure-gamedev (11)
- # clojure-italy (5)
- # clojure-losangeles (3)
- # clojure-poland (1)
- # clojure-spec (42)
- # clojure-uk (34)
- # clojurescript (182)
- # core-async (5)
- # core-logic (2)
- # cursive (17)
- # datascript (12)
- # datomic (33)
- # emacs (8)
- # figwheel (1)
- # fulcro (25)
- # jobs (6)
- # jobs-discuss (27)
- # lein-figwheel (1)
- # lumo (18)
- # off-topic (17)
- # onyx (5)
- # pedestal (7)
- # re-frame (30)
- # reagent (52)
- # remote-jobs (1)
- # ring (2)
- # ring-swagger (1)
- # shadow-cljs (40)
- # spacemacs (5)
- # sql (31)
- # unrepl (12)
- # vim (25)
Just stumbled upon this Haskell discussion... Frankly, I would recommend against LYAH. Imo, the best books are Graham Hutton's Programming in Haskell and _Haskell Programming from First Principles (http://haskellbook.com/). Both will cover Applicatives since as of 2014 they're a superset of Monads, whereas LYAH doesn't discuss them at all.
As for Applicatives, the type f (a -> b) -> f a -> f b
means it takes two arguments (since Haskell is curried): a (higher order) function that f
with input of a function from type variables a -> b
and the same function f
applied to an input of type a
. It then returns an application of f
to an input of type b
. The most obvious example is fmap
, which is a lot like Clojure's map
but polymorphic in its return values. If you just apply the identity function to the function passed to it using Applicative's pure
, which is defined as pure id <*> v = v
, then you get fmap f x = pure f <*> x
. I'm sure this sounds unnecessarily obfuscated, but it makes more sense if you know some common monad instances in which case you sometimes use the Applicative version instead and get a nice statically analyzable function.
For example, pure
is the same as return
in the Monad
typeclass and <*>
is the same as Monad
's ap
: ap :: (Monad m) => m (a -> b) -> m a -> m b
(the part before =>
is a constraint, i.e. the type variable m
must be an instance of Monad
.
you use f
for both the function and the Applicative typeclass variable, which is super confusing IMO
LYAH was a fantastic read IMHO, and a very approachable introduction to functors, applicatives, and monads.
Brian Londsorf has a free course in Egghead about these concepts using JS. I learned a lot from that. And he talked about them in a practical context, and not just abstract math.
https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript
@blueberry: is there support for cublas from clojurecuda in the pipelines ?
Has anyone taken a look a Flutter (Google new Android/iOS UI framework using Dart)? I haven't done any sort of mobile app development (outside of higher level frameworks like ionic). Does Clojure have any future on mobile?