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 #-}
18module Language.PureScript.Kinds where
21import qualified Data.Aeson.TH as A
23import Control.Applicative
24import Control.Monad.Unify (Unknown)
27-- The data type of kinds
31 -- Unification variable of type Kind
39 -- The kind of effects
43 -- Kinds for labelled, unordered rows without duplicates
49 | FunKind Kind Kind deriving (Show, Eq, Ord, Data, Typeable)
51$(A.deriveJSON A.defaultOptions ''Kind)
53everywhereOnKinds :: (Kind -> Kind) -> Kind -> Kind
54everywhereOnKinds f = go
56 go (Row k1) = f (Row (go k1))
57 go (FunKind k1 k2) = f (FunKind (go k1) (go k2))
60everywhereOnKindsM :: (Functor m, Applicative m, Monad m) => (Kind -> m Kind) -> Kind -> m Kind
61everywhereOnKindsM f = go
63 go (Row k1) = (Row <$> go k1) >>= f
64 go (FunKind k1 k2) = (FunKind <$> go k1 <*> go k2) >>= f
67everythingOnKinds :: (r -> r -> r) -> (Kind -> r) -> Kind -> r
68everythingOnKinds (<>) f = go
70 go k@(Row k1) = f k <> go k1
71 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