"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1634933215,
- "narHash": "sha256-TwLp3GXJCD1n5mvQHnB8Eaqx4ogYlGdQ2cM9enH9ps0=",
+ "lastModified": 1635110579,
+ "narHash": "sha256-QJzT/ts3reR1wtezw6/05lOur2BhF8ec1IsD7PQ1yEs=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "c47fcb70c6885d6df869934280ebeb715ca7e6fd",
+ "rev": "6b23e8fc7820366e489377b5b00890f088f36a01",
"type": "github"
},
"original": {
]
},
"locked": {
- "lastModified": 1633727277,
- "narHash": "sha256-BCNO4Li6FX7vxRduNiaHGzOOt2enQarXXejerBkdxhM=",
+ "lastModified": 1635380370,
+ "narHash": "sha256-2TS2EonIm5rB/FuaQF8O0JJMeRsX0cFoz/nfawHiF5U=",
"ref": "main",
- "rev": "f4614652719c5f04e0d89bad51545de60f6cd3ab",
+ "rev": "15f57d4bc533cb5a5c355b755b518f5a23a0011b",
"revCount": 48,
"type": "git",
"url": "https://git.code.sourcephile.fr/~julm/symantic-base"
module Symantic.Formatter
( module Symantic.Formatter.Class
, module Symantic.Formatter.Plain
- , module Symantic.Formatter.Output
) where
import Symantic.Formatter.Class
import Symantic.Formatter.Plain
-import Symantic.Formatter.Output
module Symantic.Formatter.Class
( module Symantic.Formatter.Class
, Emptyable(..)
+ , Inferable(..)
, ProductFunctor(..)
+ , Repeatable(..)
, Voidable(..)
+ , bool
+ , char
+ , int
+ , natural
+ , string
) where
-import Data.Bool
+import Data.Bool hiding (bool)
import Data.Char (Char)
import Data.Foldable (Foldable)
import Data.Function ((.), ($))
import Data.Maybe (Maybe(..))
import Data.Ord (Ord(..))
import Prelude (fromIntegral, pred)
-import Data.String (String)
import Data.Traversable (Traversable)
import Numeric.Natural (Natural)
import qualified Data.Functor as Fct
import Symantic.Derive
import Symantic.Class
( Emptyable(..)
+ , Inferable(..)
, ProductFunctor(..)
+ , Repeatable(..)
, Voidable(..)
+ , bool
+ , char
+ , int
+ , natural
+ , string
)
concat ::
Foldable f => f (repr ()) -> repr ()
concat = Fold.foldr (.>) empty
+-- * Class 'Repeatable'
+many :: Repeatable repr => repr a -> repr [a]
+many = many0
+some :: Repeatable repr => repr a -> repr [a]
+some = many1
+
-- * Class 'Spaceable'
class
( ProductFunctor repr
-- * Class 'Justifiable'
class Justifiable repr where
justify :: repr a -> repr a
-
--- * Class 'Inferable'
-class Inferable a repr where
- infer :: repr a
- default infer :: FromDerived (Inferable a) repr => repr a
- infer = liftDerived infer
-string :: Inferable String repr => repr String
-string = infer
-int :: Inferable Int repr => repr Int
-int = infer
-natural :: Inferable Natural repr => repr Natural
-natural = infer
import qualified Data.Text.Lazy as TL
--import qualified Data.Text.Lazy.Builder as TLB
-import Symantic.Class
- ( Repeatable(..)
- )
-import Symantic.Formatter.Class
+import Symantic.Formatter.Class hiding (char)
import Symantic.Formatter.Output
-- * Type 'Plain'
import Test.Tasty
import Test.Tasty.HUnit
-import Data.Foldable (Foldable(..))
-import Data.Function (($), (.))
+import Data.Function (($))
import Data.Functor ((<$>))
import Data.Int (Int)
import Data.Maybe (Maybe(..))
-import Data.Ord (Ord(..))
-import Data.String (String, IsString(..))
-import Prelude ((+))
+import Data.String (String)
import Text.Show (Show(..))
import qualified Data.List as List