Skip to content

Commit

Permalink
fixed Iso type error, and test build error
Browse files Browse the repository at this point in the history
  • Loading branch information
BebeSparkelSparkel committed Mar 23, 2024
1 parent 5480b94 commit 7ece996
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 11 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
cabal-version: 2.0
cabal-version: 2.2

-- This file has been generated from package.yaml by hpack version 0.36.0.
--
-- see: https://github.com/sol/hpack

name: biparsing
name: biparsing-core
version: 0.0.0.1
synopsis: Core modules for biparsing.
category: Parsing
homepage: https://github.com/BebeSparkelSparkel/biparsing
author: William Rusnack
maintainer: William Rusnack
license: BSD-3-Clause
license-file: LICENSE
build-type: Simple

library
Expand Down Expand Up @@ -144,10 +151,12 @@ test-suite spec
OverloadedLists
NamedFieldPuns
ghc-options: -Werror -Weverything -fprint-potential-instances -Wno-implicit-prelude -Wno-incomplete-uni-patterns -Wno-missing-deriving-strategies -Wno-missing-export-lists -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-safe-haskell-mode -Wno-orphans -Wno-safe -Wno-unsafe -Wno-unused-packages
build-tool-depends:
hspec-discover:hspec-discover
build-depends:
QuickCheck
, base
, biparsing
, biparsing-core
, bytestring
, containers
, data-default
Expand Down
10 changes: 9 additions & 1 deletion biparsing-core/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: biparsing-core
version: 0.0.0.1
synopsis: Core modules for biparsing.
homepage: https://github.com/BebeSparkelSparkel/biparsing
category: Parsing
author: William Rusnack
license: BSD-3-Clause
license-file: LICENSE

spec-version: 0.36.0

dependencies:
Expand Down Expand Up @@ -76,11 +83,12 @@ library:

tests:
spec:
build-tools: hspec-discover
main: Spec.hs
source-dirs: tests/
dependencies:
- QuickCheck
- biparsing
- biparsing-core
- bytestring
- generic-deriving
- generic-random
Expand Down
5 changes: 5 additions & 0 deletions biparsing-core/tests/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,8 @@ instance (Functor n, Monoid w) => BackwardC c n w where
backwardT = rwsT
runBackwardT = runRWST

instance UpdateStateWithElement () (Identity ss) where
updateElementContext _ _ = Identity
instance UpdateStateWithSubState () (Identity ss) where
updateSubStateContext _ _ = Identity

30 changes: 30 additions & 0 deletions biparsing-mixes/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Copyright Author William Rusnack (c) 2020

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of Author name here nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 changes: 12 additions & 3 deletions biparsing-mixes/biparsing-mixes.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
cabal-version: 2.0
cabal-version: 2.2

-- This file has been generated from package.yaml by hpack version 0.36.0.
--
-- see: https://github.com/sol/hpack

name: biparsing-mixes
version: 0.0.0.1
synopsis: Easy to use monad and type mixes for biparsing.
category: Parsing
homepage: https://github.com/BebeSparkelSparkel/biparsing
author: William Rusnack
maintainer: William Rusnack
license: BSD-3-Clause
license-file: ../LICENSE
build-type: Simple

library
Expand Down Expand Up @@ -36,7 +43,7 @@ library
ghc-options: -Werror -Weverything -Wno-implicit-prelude -Wno-missing-deriving-strategies -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-safe-haskell-mode -Wno-safe -Wno-unsafe -Wno-unused-packages
build-depends:
base
, biparsing
, biparsing-core
, bytestring
, mono-traversable >=1.0.17.0
, text
Expand Down Expand Up @@ -65,9 +72,11 @@ test-suite spec
OverloadedStrings
TupleSections
ghc-options: -Werror -Weverything -fprint-potential-instances -Wno-implicit-prelude -Wno-incomplete-uni-patterns -Wno-missing-deriving-strategies -Wno-missing-export-lists -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-safe-haskell-mode -Wno-orphans -Wno-safe -Wno-unsafe -Wno-unused-packages
build-tool-depends:
hspec-discover:hspec-discover
build-depends:
base
, biparsing
, biparsing-core
, biparsing-mixes
, bytestring
, data-default
Expand Down
5 changes: 3 additions & 2 deletions biparsing-mixes/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: biparsing-mixes
version: 0.0.0.1
synopsis: Easy to use monad and type mixes for biparsing.
homepage: https://github.com/BebeSparkelSparkel/biparsing
catagory: Parsing
category: Parsing
author: William Rusnack
license: BSD-3-Clause
license-file: ../LICENSE
license-file: LICENSE
spec-version: 0.36.0

dependencies:
Expand Down Expand Up @@ -56,6 +56,7 @@ library:

tests:
spec:
build-tools: hspec-discover
main: Spec.hs
source-dirs: tests/
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion biparsing-mixes/src/Biparse/Mixes/Either.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import Data.Functor.Identity (Identity)
-- | Try using these types and functions before using the more general ones in the next section.

type BiparserEasy c ss u v = Biparser c ss () () u v
type IsoEasy c ss v = Iso c () ss () v
type IsoEasy c ss v = Iso c () () ss v
--type Unit c ss r w ws = Biparser css r w ws () ()
--type UnitEasy c ss r w ws = Biparser css r w ws () ()
--type Const c s m n r w ws u =
Expand Down
1 change: 1 addition & 0 deletions biparsing-mixes/tests/Biparse/Mixes/EitherSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ spec = do
it "Forward" $ fw naturalBaseTen def "123" `shouldBe` Right (123 :: Word8)

$(doE $ noBindS . (\(c,ss) -> varE "typedTests" `appTypeE` c `appTypeE` ss) <$> combinations contexts subStates)

3 changes: 3 additions & 0 deletions biparsing-mixes/tests/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module Prelude
, module Data.Ix
, module Biparse.Mixes.SubStates
, module Data.Word
, module GHC.Err

, contexts
, subStates
Expand All @@ -43,6 +44,7 @@ import Text.Printf (IsChar, fromChar, toChar)
import Text.Show (Show)
import Data.Ix (Ix)
import Biparse.Mixes.SubStates
import GHC.Err (undefined)

instance IsString Name where fromString = mkName
instance IsString TypeQ where fromString = conT . mkName
Expand Down Expand Up @@ -75,3 +77,4 @@ combinations :: [a] -> [b] -> [(a,b)]
combinations xs ys = foldMap (\x -> (x,) <$> ys) xs

instance Eq BB.Builder where x == y = BB.toLazyByteString x == BB.toLazyByteString y

3 changes: 2 additions & 1 deletion watch.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

target=$1
continue=true

packageFiles() {
Expand All @@ -22,7 +23,7 @@ cabalWatch() {
echo cabalWatch
while [ $continue = true ]
do
cabalAndHaskellFiles | entr -cd cabal test -O0
cabalAndHaskellFiles | entr -cd cabal $target -O0
done
}

Expand Down

0 comments on commit 7ece996

Please sign in to comment.