tsahyt 2017-02-28 21:46:00
phadej: thanks, I'll add this to my reading list
tsahyt 2017-02-28 22:06:41
are there any kind of accepted naming conventions for specializing f a -> f b to f ~= Identity?
tsahyt 2017-02-28 22:07:40
e.g. I have some function returning f a -> f b, and for convenience I think it'd be nice to have a specialized version that just returns a -> b. the types are of course determined by the other parameters, so it's not fully polymorphic
Cale 2017-02-28 22:17:44
:t ala Identity
lambdabot 2017-02-28 22:17:47
Functor f => ((b -> Identity b) -> f (Identity b1)) -> f b1
tsahyt 2017-02-28 22:18:59
where is ala from?
Cale 2017-02-28 22:19:03
Newtype
Cale 2017-02-28 22:19:08
https://hackage.haskell.org/package/newtype-0.2/docs/Control-Newtype.html
Cale 2017-02-28 22:19:25
:t under Identity
lambdabot 2017-02-28 22:19:28
error:
lambdabot 2017-02-28 22:19:28
• Couldn't match type 'Identity
lambdabot 2017-02-28 22:19:28
(Control.Lens.Internal.Iso.Exchange a b a (Identity b))'
Cale 2017-02-28 22:19:43
hm
Cale 2017-02-28 22:20:31
Though I would say just make the specialised function
Gurkenglas 2017-02-28 22:20:34
tsahyt, see evalState vs evalStateT etc
Cale 2017-02-28 22:21:57
ohh
Cale 2017-02-28 22:21:59
:t ala
lambdabot 2017-02-28 22:22:02
(Rewrapped t s, Rewrapped s t, Functor f) => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> f s) -> f (Unwrapped s)
Cale 2017-02-28 22:22:08
Right, it's lens' ala
Cale 2017-02-28 22:22:14
:t under
lambdabot 2017-02-28 22:22:16
AnIso s t a b -> (t -> s) -> b -> a
Cale 2017-02-28 22:22:20
:)
Gurkenglas 2017-02-28 22:22:32
Though it's kinda sad that the shorter type gets the shorter name, because here it feels like evalStateT would pop out first if you derived Haskell platonically optimally
zuck007 2017-02-28 22:26:58
can anybody recommend some cool projects idea for haskell beginner
suppi 2017-02-28 22:36:28
maybe something here at the bottom? http://gilmi.xyz/post/2015/02/25/after-lyah
suppi 2017-02-28 22:37:18
oh, left.