haskell - What is the purpose of * in the ReaderT Monad Transformer? -
i looking @ the documentation reader monad , readert monad transformer.
the relevant definitions are:
newtype readert k r m :: forall k. * -> (k -> *) -> k -> * type reader r = readert * r identity
i don't understand *
doing in definitions. in particular attempting derive new monad readert io base monad , class constraint on r
value.
i not sure why there fourth input readert (k
) , reader doing value when puts * in position.
*
kind of types values : stands things int
, list int
etc..
forall k
means k
not of kind. stands kind of types, viewed static things can declare , manipulate, not associated runtime values. 1 example of when want 'decorate' other type information : embroidering type has no reason have sort of value attached it, "pure" information, embroided type (which have values)
more here, can see in reader
gets specialized *
, , m
specialised identity
monad. that's you'd want io
monad be.
as constraints, best not specify in type itself. upon usage, use particular method attached typeclass, added on fly. indeed there no reason expressions written not use method should burdened requiring callers provide it.
(unless have reason to, deducing other instances, in dict
capture typeclass witness runtime value gadt, that's not want do)
Comments
Post a Comment