Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Haskell parallel to unison/base.Doc
.
These types have two significant parameters: ident
and code
that are expected to be parameterized by some
representation of identifiers and source code of the host language.
This is much more restricted than unison/base.Doc
, but it covers everything we can parse from Haskell. The
mismatch with Unison is a problem, as someone can create a Unison Doc with explicit constructors or function calls,
have it rendered to a scratch file, and then we can’t parse it. Changing the types here to match Unison wouldn’t
fix the issue. We have to modify the types and parser in concert (in both Haskell and Unison) to bring them in
line.
Synopsis
- newtype UntitledSection a = UntitledSection [a]
- newtype Paragraph a = Paragraph (NonEmpty a)
- data List a
- = BulletedList (NonEmpty (Column a))
- | NumberedList (NonEmpty (Word64, Column a))
- data Column a = Column (Paragraph a) (Maybe (List a))
- data Top code leaf a
- data EmbedLink a = EmbedLink a
- newtype Transclude a = Transclude a
- newtype EmbedAnnotation ident a = EmbedAnnotation (Either ident a)
- data SourceElement ident a = SourceElement (EmbedLink ident) [EmbedAnnotation ident a]
- newtype EmbedSignatureLink a = EmbedSignatureLink a
- newtype Word = Word String
- newtype Join a = Join (NonEmpty a)
- newtype Group a = Group (Join a)
- data Leaf ident code a
- = Link (EmbedLink ident)
- | NamedLink (Paragraph a) (Group a)
- | Example code
- | Transclude' (Transclude code)
- | Bold (Paragraph a)
- | Italic (Paragraph a)
- | Strikethrough (Paragraph a)
- | Verbatim Word
- | Code Word
- | Source (NonEmpty (SourceElement ident (Transclude code)))
- | FoldedSource (NonEmpty (SourceElement ident (Transclude code)))
- | EvalInline code
- | Signature (NonEmpty (EmbedSignatureLink ident))
- | SignatureInline (EmbedSignatureLink ident)
- | Word' Word
- | Group' (Group a)
Documentation
newtype UntitledSection a Source #
UntitledSection [a] |
Instances
Instances
BulletedList (NonEmpty (Column a)) | |
NumberedList (NonEmpty (Word64, Column a)) |
Instances
Foldable List Source # | |
Defined in Unison.Syntax.Parser.Doc.Data fold :: Monoid m => List m -> m # foldMap :: Monoid m => (a -> m) -> List a -> m # foldMap' :: Monoid m => (a -> m) -> List a -> m # foldr :: (a -> b -> b) -> b -> List a -> b # foldr' :: (a -> b -> b) -> b -> List a -> b # foldl :: (b -> a -> b) -> b -> List a -> b # foldl' :: (b -> a -> b) -> b -> List a -> b # foldr1 :: (a -> a -> a) -> List a -> a # foldl1 :: (a -> a -> a) -> List a -> a # elem :: Eq a => a -> List a -> Bool # maximum :: Ord a => List a -> a # | |
Eq1 List Source # | |
Ord1 List Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
Show1 List Source # | |
Traversable List Source # | |
Functor List Source # | |
Show a => Show (List a) Source # | |
Eq a => Eq (List a) Source # | |
Ord a => Ord (List a) Source # | |
Instances
Foldable Column Source # | |
Defined in Unison.Syntax.Parser.Doc.Data fold :: Monoid m => Column m -> m # foldMap :: Monoid m => (a -> m) -> Column a -> m # foldMap' :: Monoid m => (a -> m) -> Column a -> m # foldr :: (a -> b -> b) -> b -> Column a -> b # foldr' :: (a -> b -> b) -> b -> Column a -> b # foldl :: (b -> a -> b) -> b -> Column a -> b # foldl' :: (b -> a -> b) -> b -> Column a -> b # foldr1 :: (a -> a -> a) -> Column a -> a # foldl1 :: (a -> a -> a) -> Column a -> a # elem :: Eq a => a -> Column a -> Bool # maximum :: Ord a => Column a -> a # minimum :: Ord a => Column a -> a # | |
Eq1 Column Source # | |
Ord1 Column Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
Show1 Column Source # | |
Traversable Column Source # | |
Functor Column Source # | |
Show a => Show (Column a) Source # | |
Eq a => Eq (Column a) Source # | |
Ord a => Ord (Column a) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data |
Section (Paragraph leaf) [a] | |
Eval code | |
ExampleBlock code | |
CodeBlock String String | |
List' (List leaf) | |
Paragraph' (Paragraph leaf) |
Instances
Bifoldable (Top code) Source # | |
Bifunctor (Top code) Source # | |
Bitraversable (Top code) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Top code a b -> f (Top code c d) # | |
Eq code => Eq2 (Top code) Source # | |
Ord code => Ord2 (Top code) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
Show code => Show2 (Top code) Source # | |
Foldable (Top code leaf) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data fold :: Monoid m => Top code leaf m -> m # foldMap :: Monoid m => (a -> m) -> Top code leaf a -> m # foldMap' :: Monoid m => (a -> m) -> Top code leaf a -> m # foldr :: (a -> b -> b) -> b -> Top code leaf a -> b # foldr' :: (a -> b -> b) -> b -> Top code leaf a -> b # foldl :: (b -> a -> b) -> b -> Top code leaf a -> b # foldl' :: (b -> a -> b) -> b -> Top code leaf a -> b # foldr1 :: (a -> a -> a) -> Top code leaf a -> a # foldl1 :: (a -> a -> a) -> Top code leaf a -> a # toList :: Top code leaf a -> [a] # null :: Top code leaf a -> Bool # length :: Top code leaf a -> Int # elem :: Eq a => a -> Top code leaf a -> Bool # maximum :: Ord a => Top code leaf a -> a # minimum :: Ord a => Top code leaf a -> a # | |
(Eq code, Eq leaf) => Eq1 (Top code leaf) Source # | |
(Ord code, Ord leaf) => Ord1 (Top code leaf) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
(Show code, Show leaf) => Show1 (Top code leaf) Source # | |
Traversable (Top code leaf) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
Functor (Top code leaf) Source # | |
(Show leaf, Show a, Show code) => Show (Top code leaf a) Source # | |
(Eq leaf, Eq a, Eq code) => Eq (Top code leaf a) Source # | |
(Ord leaf, Ord a, Ord code) => Ord (Top code leaf a) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data compare :: Top code leaf a -> Top code leaf a -> Ordering # (<) :: Top code leaf a -> Top code leaf a -> Bool # (<=) :: Top code leaf a -> Top code leaf a -> Bool # (>) :: Top code leaf a -> Top code leaf a -> Bool # (>=) :: Top code leaf a -> Top code leaf a -> Bool # max :: Top code leaf a -> Top code leaf a -> Top code leaf a # min :: Top code leaf a -> Top code leaf a -> Top code leaf a # |
This is a deviation from the Unison Doc data model – in Unison, Doc distinguishes between type and term links, but here Doc knows nothing about what namespaces may exist.
Instances
newtype Transclude a Source #
Instances
newtype EmbedAnnotation ident a Source #
EmbedAnnotation (Either ident a) |
Instances
data SourceElement ident a Source #
SourceElement (EmbedLink ident) [EmbedAnnotation ident a] |
Instances
newtype EmbedSignatureLink a Source #
Instances
Instances
Foldable Join Source # | |
Defined in Unison.Syntax.Parser.Doc.Data fold :: Monoid m => Join m -> m # foldMap :: Monoid m => (a -> m) -> Join a -> m # foldMap' :: Monoid m => (a -> m) -> Join a -> m # foldr :: (a -> b -> b) -> b -> Join a -> b # foldr' :: (a -> b -> b) -> b -> Join a -> b # foldl :: (b -> a -> b) -> b -> Join a -> b # foldl' :: (b -> a -> b) -> b -> Join a -> b # foldr1 :: (a -> a -> a) -> Join a -> a # foldl1 :: (a -> a -> a) -> Join a -> a # elem :: Eq a => a -> Join a -> Bool # maximum :: Ord a => Join a -> a # | |
Eq1 Join Source # | |
Ord1 Join Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
Show1 Join Source # | |
Traversable Join Source # | |
Functor Join Source # | |
Show a => Show (Join a) Source # | |
Eq a => Eq (Join a) Source # | |
Ord a => Ord (Join a) Source # | |
Instances
Foldable Group Source # | |
Defined in Unison.Syntax.Parser.Doc.Data fold :: Monoid m => Group m -> m # foldMap :: Monoid m => (a -> m) -> Group a -> m # foldMap' :: Monoid m => (a -> m) -> Group a -> m # foldr :: (a -> b -> b) -> b -> Group a -> b # foldr' :: (a -> b -> b) -> b -> Group a -> b # foldl :: (b -> a -> b) -> b -> Group a -> b # foldl' :: (b -> a -> b) -> b -> Group a -> b # foldr1 :: (a -> a -> a) -> Group a -> a # foldl1 :: (a -> a -> a) -> Group a -> a # elem :: Eq a => a -> Group a -> Bool # maximum :: Ord a => Group a -> a # minimum :: Ord a => Group a -> a # | |
Eq1 Group Source # | |
Ord1 Group Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
Show1 Group Source # | |
Traversable Group Source # | |
Functor Group Source # | |
Show a => Show (Group a) Source # | |
Eq a => Eq (Group a) Source # | |
Ord a => Ord (Group a) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data |
data Leaf ident code a Source #
Link (EmbedLink ident) | |
NamedLink (Paragraph a) (Group a) | the Group always contains either a single Term/Type link or list of |
Example code | |
Transclude' (Transclude code) | |
Bold (Paragraph a) | |
Italic (Paragraph a) | |
Strikethrough (Paragraph a) | |
Verbatim Word | |
Code Word | |
Source (NonEmpty (SourceElement ident (Transclude code))) | |
FoldedSource (NonEmpty (SourceElement ident (Transclude code))) | |
EvalInline code | |
Signature (NonEmpty (EmbedSignatureLink ident)) | |
SignatureInline (EmbedSignatureLink ident) | |
Word' Word | |
Group' (Group a) |
Instances
Bifunctor (Leaf ident) Source # | |
Eq ident => Eq2 (Leaf ident) Source # | |
Ord ident => Ord2 (Leaf ident) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
Show ident => Show2 (Leaf ident) Source # | |
Foldable (Leaf ident code) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data fold :: Monoid m => Leaf ident code m -> m # foldMap :: Monoid m => (a -> m) -> Leaf ident code a -> m # foldMap' :: Monoid m => (a -> m) -> Leaf ident code a -> m # foldr :: (a -> b -> b) -> b -> Leaf ident code a -> b # foldr' :: (a -> b -> b) -> b -> Leaf ident code a -> b # foldl :: (b -> a -> b) -> b -> Leaf ident code a -> b # foldl' :: (b -> a -> b) -> b -> Leaf ident code a -> b # foldr1 :: (a -> a -> a) -> Leaf ident code a -> a # foldl1 :: (a -> a -> a) -> Leaf ident code a -> a # toList :: Leaf ident code a -> [a] # null :: Leaf ident code a -> Bool # length :: Leaf ident code a -> Int # elem :: Eq a => a -> Leaf ident code a -> Bool # maximum :: Ord a => Leaf ident code a -> a # minimum :: Ord a => Leaf ident code a -> a # | |
(Eq ident, Eq code) => Eq1 (Leaf ident code) Source # | |
(Ord ident, Ord code) => Ord1 (Leaf ident code) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data | |
(Show ident, Show code) => Show1 (Leaf ident code) Source # | |
Traversable (Leaf ident code) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data traverse :: Applicative f => (a -> f b) -> Leaf ident code a -> f (Leaf ident code b) # sequenceA :: Applicative f => Leaf ident code (f a) -> f (Leaf ident code a) # mapM :: Monad m => (a -> m b) -> Leaf ident code a -> m (Leaf ident code b) # sequence :: Monad m => Leaf ident code (m a) -> m (Leaf ident code a) # | |
Functor (Leaf ident code) Source # | |
(Show ident, Show a, Show code) => Show (Leaf ident code a) Source # | |
(Eq ident, Eq a, Eq code) => Eq (Leaf ident code a) Source # | |
(Ord ident, Ord a, Ord code) => Ord (Leaf ident code a) Source # | |
Defined in Unison.Syntax.Parser.Doc.Data compare :: Leaf ident code a -> Leaf ident code a -> Ordering # (<) :: Leaf ident code a -> Leaf ident code a -> Bool # (<=) :: Leaf ident code a -> Leaf ident code a -> Bool # (>) :: Leaf ident code a -> Leaf ident code a -> Bool # (>=) :: Leaf ident code a -> Leaf ident code a -> Bool # max :: Leaf ident code a -> Leaf ident code a -> Leaf ident code a # min :: Leaf ident code a -> Leaf ident code a -> Leaf ident code a # |