Created
February 15, 2017 00:11
-
-
Save caiorss/0356836a692b3d34bd76f607f6e7185d to your computer and use it in GitHub Desktop.
A haddock cheat sheet because I'm incapable of remembering this shit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-| | |
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