1-----------------------------------------------------------------------------
3-- Module : Language.PureScript.Kinds
4-- Copyright : (c) Phil Freeman 2013
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
13-----------------------------------------------------------------------------
15{-# LANGUAGE DeriveDataTypeable #-}
16{-# LANGUAGE TemplateHaskell #-}
19module Language.PureScript.Kinds where
22import qualified Data.Aeson.TH as A
24#if __GLASGOW_HASKELL__ < 710
25import Control.Applicative
29-- The data type of kinds
33 -- Unification variable of type Kind
41 -- The kind of effects
45 -- Kinds for labelled, unordered rows without duplicates
51 | FunKind Kind Kind deriving (Show, Read, Eq, Ord, Data, Typeable)
53$(A.deriveJSON A.defaultOptions ''Kind)
55everywhereOnKinds :: (Kind -> Kind) -> Kind -> Kind
56everywhereOnKinds f = go
58 go (Row k1) = f (Row (go k1))
59 go (FunKind k1 k2) = f (FunKind (go k1) (go k2))
62everywhereOnKindsM :: (Functor m, Applicative m, Monad m) => (Kind -> m Kind) -> Kind -> m Kind
63everywhereOnKindsM f = go
65 go (Row k1) = (Row <$> go k1) >>= f
66 go (FunKind k1 k2) = (FunKind <$> go k1 <*> go k2) >>= f
69everythingOnKinds :: (r -> r -> r) -> (Kind -> r) -> Kind -> r
70everythingOnKinds (<>) f = go
72 go k@(Row k1) = f k <> go k1
73 go k@(FunKind k1 k2) = f k <> go k1 <> go k2
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list