Instantly share code, notes, and snippets.

Embed
What would you like to do?
A haddock cheat sheet because I'm incapable of remembering this shit.
{-|
Module : module documentation
Description : as;ldkjf
Copyright : >implying
License : >implying
Maintainer : lol
Stability : not
Portability : what
Module description here
@
-- some code becuause why not
f x = x - 1
@
Properties
prop> f . g = g (f x)
Or an actual example
>>> f 9
8
-}
module Lols
(
-- * Classes
Lmao(..),
-- * Types
Ayy,
-- * Functions,
f,
g
) where
-- * Classes
Class Lmao a where
-- |
asdf :: a -> Int
-- * Types
-- | Or even
data Ayy
= X -- ^ on the
| Y -- ^ same line
-- * Functions
-- | A single-line comment, but it can have
-- lines following like normal.
f :: Ayy -- ^ Here's how to document
-> Lmao a -- ^ individual arguments
f = undefined
g :: a
-- ^ Can go after the declaration too.
g = undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment