Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mikeplus64/record
base: 0afae165eb
...
head fork: mikeplus64/record
compare: 9cc8a9119c
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 8 additions and 2 deletions.
  1. +1 −1  record.cabal
  2. +7 −1 src/Data/Record.hs
View
2  record.cabal
@@ -1,5 +1,5 @@
name: record
-version: 0.1.0.22
+version: 0.1.0.23
synopsis: Efficient, type safe records implemented using GADTs and type level strings.
homepage: http://quasimal.com/projects/records
license: BSD3
View
8 src/Data/Record.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE GADTs, TypeFamilies, UndecidableInstances, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, ConstraintKinds, DataKinds, TypeOperators, PolyKinds, EmptyDataDecls, Rank2Types, ExistentialQuantification, FunctionalDependencies, KindSignatures, OverlappingInstances, TemplateHaskell #-}
-module Data.Record where
+module Data.Record (key, set, alt, get, Record, P, (&), end, unbox, box, transform, run, runtrans, access, write, alter) where
import Language.Haskell.TH.Syntax
import Language.Haskell.TH.Quote
import Language.Haskell.TH.Lib
@@ -13,12 +13,18 @@ data Key k
key :: String -> Q Exp
key s = [| undefined :: Key $(litT . return . StrTyLit $ s) |]
+-- | See 'write'
+-- [set|x|] == write (undefined :: Key x)
set :: QuasiQuoter
set = QuasiQuoter { quoteExp = \s -> [| write $(key s) |], quoteType = undefined, quoteDec = undefined, quotePat = undefined }
+-- | See 'alter'
+-- > [alt|x|] == alter (undefined :: Key x)
alt :: QuasiQuoter
alt = QuasiQuoter { quoteExp = \s -> [| alter $(key s) |], quoteType = undefined, quoteDec = undefined, quotePat = undefined }
+-- | See 'access'.
+-- > [get|x|] == access (undefined :: Key x)
get :: QuasiQuoter
get = QuasiQuoter { quoteExp = \s -> [| access $(key s) |], quoteType = undefined, quoteDec = undefined, quotePat = undefined }

No commit comments for this range

Something went wrong with that request. Please try again.