m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/haskellExtensions.md
blob: 9346691a6e69710c289d89b3841561a5fcdc6045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# LANGUAGE pragma Haskell extensions

List: https://downloads.haskell.org/~ghc/7.0.3/docs/html/libraries/Cabal-1.10.1.0/Language-Haskell-Extension.html

## Using

Put as *first* line of file:

    {-# LANGUAGE Extension, ... -#}

## FlexibleContexts

Relax some restrictions on the form of the context of a type signature.

Normally typeclass constraints have to have type variable arguments.

    modify :: MonadState s m => (s -> s) -> m ()

With FlexibleContexts, can be any type (?)

    modifyFst :: MonadState (a, b) m => (a -> a) -> m ()