i-am-tom / haskell-exercises Goto Github PK
View Code? Open in Web Editor NEWA little course to learn about some of the more obscure GHC extensions.
License: MIT License
A little course to learn about some of the more obscure GHC extensions.
License: MIT License
@i-am-tom I am going through the haskell exercises, and in the KindSignatures
section I noticed that you explain how class Something a
will have a kind of *
, and you can change that by adding the KindSignatures
pragma.
I think this is great, but I feel there’s a step in between that could be explained to avoid confusion. That is, GHC will correctly infer the type of a based on the method signatures provided, and most of the time you will provide method signatures, so you might not need to jump straight into KindSignatures for it.
class Functor f where
fmap :: (a -> b) -> f a -> f b
:k Functor
Functor :: (* -> *) -> Constraint
class Stuff a where
lol :: a b c d
:k Stuff
Stuff :: (* -> * -> * -> *) -> Constraint
This also explains why you mention that it’s a good pragma to make documentation more explicit.
A few notes on the MPTC explanation while I remember:
Sneaky
instance, but the text suggests it will fail (and the explanation for why, on L213, refers to Transform
rather than Sneaky
)Thank you so much for the course!
Is there any link to the canonical solutions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.