Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module headers and some other miscellanous docs #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion digit.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license-file: LICENCE
author: Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
maintainer: Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
copyright: Copyright (C) 2010-2016 NICTA Limited
Copyright (c) 2017, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230.
Copyright (c) 2017-2018, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230.
synopsis: A data-type representing digits 0-9 and other combinations
category: Data
homepage: https://github.com/qfpl/digit
Expand Down
10 changes: 10 additions & 0 deletions src/Data/Digit.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit (
module Data.Digit.Binary
, module Data.Digit.Decimal
Expand Down
16 changes: 14 additions & 2 deletions src/Data/Digit/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TemplateHaskell #-}

{-|
Module : Data.Digit.Binary
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Binary(
BinDigit(..)
, BinaryNoZero
Expand All @@ -24,6 +34,7 @@ import Text.Parser.Combinators((<?>), choice)
import Data.Digit.Class.D0
import Data.Digit.Class.D1

-- | A single bit. Either zero or one.
data BinDigit
= BinDigit0
| BinDigit1
Expand All @@ -34,15 +45,16 @@ makePrisms ''BinDigit
instance D0 BinDigit where; d0 = _BinDigit0
instance D1 BinDigit where; d1 = _BinDigit1

type BinaryNoZero d =
D1 d
type BinaryNoZero =
D1

parseBinaryNoZero ::
(BinaryNoZero d, CharParsing p) =>
p d
parseBinaryNoZero =
parse1 <?> "BinaryNoZero"

-- | A constraint for bits
type Binary d =
(D0 d, BinaryNoZero d)

Expand Down
10 changes: 10 additions & 0 deletions src/Data/Digit/Char.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Char
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Char(
-- * Binary
charBinaryNoZero
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D0.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleInstances #-}

{-|
Module : Data.Digit.Class.D0
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D0(
D0(..)
, parse0
Expand All @@ -19,6 +29,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 0
class D0 d where
d0 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D1.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D1
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D1(
D1(..)
, parse1
Expand All @@ -18,6 +28,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 1
class D1 d where
d1 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D2.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D2
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D2(
D2(..)
, parse2
Expand All @@ -18,6 +28,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 2
class D2 d where
d2 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D3.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D3
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D3(
D3(..)
, parse3
Expand All @@ -18,6 +28,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 3
class D3 d where
d3 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D4.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D4
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D4(
D4(..)
, parse4
Expand All @@ -18,6 +28,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 4
class D4 d where
d4 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D5.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D5
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D5(
D5(..)
, parse5
Expand All @@ -18,6 +28,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 5
class D5 d where
d5 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D6.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D6
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D6(
D6(..)
, parse6
Expand All @@ -19,6 +29,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 6
class D6 d where
d6 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D7.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D7
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D7(
D7(..)
, parse7
Expand All @@ -18,6 +28,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 7
class D7 d where
d7 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D8.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D8
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D8(
D8(..)
, parse8
Expand All @@ -18,6 +28,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 8
class D8 d where
d8 ::
Prism'
Expand Down
11 changes: 11 additions & 0 deletions src/Data/Digit/Class/D9.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.D9
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.D9(
D9(..)
, parse9
Expand All @@ -18,6 +28,7 @@ import Text.Parser.Combinators((<?>))
-- >>> import Text.Parsec(parse, ParseError, eof)
-- >>> import Data.Void(Void)

-- | Classy prism for the digit 9
class D9 d where
d9 ::
Prism'
Expand Down
10 changes: 10 additions & 0 deletions src/Data/Digit/Class/LowerCase.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.LowerCase
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.LowerCase (

-- * Classes
Expand Down
10 changes: 10 additions & 0 deletions src/Data/Digit/Class/MixedCase.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeFamilies #-}

{-|
Module : Data.Digit.Class.MixedCase
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.MixedCase
(
-- * Types
Expand Down
10 changes: 10 additions & 0 deletions src/Data/Digit/Class/UpperCase.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{-# LANGUAGE NoImplicitPrelude #-}

{-|
Module : Data.Digit.Class.UpperCase
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Class.UpperCase
(
-- * Classes
Expand Down
10 changes: 10 additions & 0 deletions src/Data/Digit/Decimal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TemplateHaskell #-}

{-|
Module : Data.Digit.Decimal
Copyright : (C) 2010-2016 NICTA Limited
(C) 2017-2018 CSIRO
License : BSD3
Maintainer : Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Stability : experimental
Portability : non-portable
-}

module Data.Digit.Decimal(
DecDigit(..)
, DecimalNoZero
Expand Down
Loading