build: update flake inputs
authorJulien Moutinho <julm@sourcephile.fr>
Wed, 27 Oct 2021 10:25:52 +0000 (12:25 +0200)
committerJulien Moutinho <julm@sourcephile.fr>
Thu, 28 Oct 2021 00:49:23 +0000 (02:49 +0200)
flake.lock
src/Symantic/Formatter.hs
src/Symantic/Formatter/Class.hs
src/Symantic/Formatter/Plain.hs
tests/HUnit.hs

index 2ae104892dfe4162fb8d95664c756dc70ac2e5c5..78c77b4f97a719a07f802cafb9637677476f5874 100644 (file)
@@ -2,11 +2,11 @@
   "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"
index d9a6c518713c35365e899e23f86fb76c0afbe21a..e902b146e85adf35d841bdcbd1290233ebb1ab20 100644 (file)
@@ -1,8 +1,6 @@
 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
index 01d650fcd12a8c06021436d65c0921d7e758c815..67b7f07e120e8552b87fe363d16076aeb63a5fd9 100644 (file)
@@ -3,11 +3,18 @@
 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 ((.), ($))
@@ -15,7 +22,6 @@ import Data.Int (Int)
 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
@@ -24,8 +30,15 @@ import qualified System.Console.ANSI as ANSI
 import Symantic.Derive
 import Symantic.Class
   ( Emptyable(..)
+  , Inferable(..)
   , ProductFunctor(..)
+  , Repeatable(..)
   , Voidable(..)
+  , bool
+  , char
+  , int
+  , natural
+  , string
   )
 
 concat ::
@@ -33,6 +46,12 @@ 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
@@ -346,15 +365,3 @@ class Wrappable repr where
 -- * 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
index aad59fa69982e9e806a7b849736fe1ea2fe4f459..97d908545217291ea47ca775f7b69c7adb7d93e1 100644 (file)
@@ -28,10 +28,7 @@ import qualified Data.Text as T
 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'
index 4ffefeb3792003c9a08fd6e2b4923c377a80535f..d27473fbdbe9fc3da86dc47a02ac21b02f70ee53 100644 (file)
@@ -4,14 +4,11 @@ module HUnit where
 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