git.iko.soy/ikoHSE/sc-project
on master help sign in
6 files changed+39−13
since splitsnapshots
unifiedsplit
README.md+9 package.yaml+2−1 src/Task.hs−5 stack.yaml+18−2 task.cabal+9−4 test/Tests.hs+1−1
README.md+9
@@ -68,18 +68,27 @@ If there are no characters to read from the input, then it should fail.
6868anyToken :: Parser Char
6969```
7070
71+This combinator should read and return exactly one character from the input.
72+If the character does not match the given character, then it should fail.
73+
7174```haskell
7275token :: Char -> Parser ()
7376```
7477
78+This combinator should read a string of charracters. If the string does not match the given string then fail.
79+
7580```haskell
7681tokens :: String -> Parser ()
7782```
7883
84+This character reads any number of consecutive characters, which stisfy the predicate. So this can never fail.
85+
7986```haskell
8087tokensWhile :: (Char -> Bool) -> Parser String
8188```
8289
90+This character reads any number (but at least one) of consecutive characters, which stisfy the predicate. This can only fail if the first character does not satisfy the predicate.
91+
8392```haskell
8493tokensWhile1 :: (Char -> Bool) -> Parser String
8594```
package.yaml+2−1
@@ -3,7 +3,7 @@ version: 0.1.0.0
33license: Unlicense
44
55dependencies:
6− - base >= 4.7 && < 5
6+ - base
77 - mtl
88
99library:
@@ -17,3 +17,4 @@ tests:
1717 - tasty
1818 - tasty-hspec
1919 - task
20+ - hspec
src/Task.hs−5
@@ -3,10 +3,5 @@ module Task
33 )
44where
55
6−import Control.Applicative
7−import Control.Monad.State.Lazy
8−import Data.Char
9−import Data.Maybe
10−
116calculate :: String -> Maybe Int
127calculate = error "TODO: calculate"
stack.yaml+18−2
@@ -1,7 +1,23 @@
1−resolver: lts-14.27
1+resolver: lts-24.23
22
33packages:
44- .
55
66ghc-options:
7− "$locals": -ddump-to-file -ddump-hi -fwarn-unused-binds -fwarn-unused-imports -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wpartial-fields -Werror=missing-home-modules -Wmissing-home-modules -Widentities -Wredundant-constraints -Wmissing-export-lists
7+ "$locals": |
8+ -Weverything
9+ -Wno-unsafe
10+ -Wno-safe
11+ -Wno-missing-safe-haskell-mode
12+ -Wno-missing-import-lists
13+ -Wno-missing-kind-signatures
14+ -Wno-all-missed-specialisations
15+ -Wno-missed-specialisations
16+ -Wno-partial-type-signatures
17+ -Wno-partial-fields
18+ -Wno-operator-whitespace
19+ -Wno-missed-extra-shared-lib
20+ -Wno-missing-role-annotations
21+ -Wno-missing-poly-kind-signatures
22+ -Wno-implicit-prelude
23+ -threaded
task.cabal+9−4
@@ -1,10 +1,10 @@
11cabal-version: 2.2
22
3−-- This file has been generated from package.yaml by hpack version 0.33.0.
3+-- This file has been generated from package.yaml by hpack version 0.37.0.
44--
55-- see: https://github.com/sol/hpack
66--
7−-- hash: b1f4ab7a3e6ea31d3a641f90b944f1c91d42ea2980c970ad21e0210599d7c284
7+-- hash: 21ebdd50fab71f48da67f5db53302dd4cca90fbcaca6500978442065c226b2f3
88
99name: task
1010version: 0.1.0.0
@@ -17,10 +17,12 @@ library
1717 Task
1818 other-modules:
1919 Paths_task
20+ autogen-modules:
21+ Paths_task
2022 hs-source-dirs:
2123 src
2224 build-depends:
23− base >=4.7 && <5
25+ base
2426 , mtl
2527 default-language: Haskell2010
2628
@@ -30,10 +32,13 @@ test-suite task-tests
3032 other-modules:
3133 Tests
3234 Paths_task
35+ autogen-modules:
36+ Paths_task
3337 hs-source-dirs:
3438 test
3539 build-depends:
36− base >=4.7 && <5
40+ base
41+ , hspec
3742 , mtl
3843 , task
3944 , tasty
test/Tests.hs+1−1
@@ -4,7 +4,7 @@ module Tests
44where
55
66import Task
7−import Test.Tasty.Hspec
7+import Test.Hspec
88
99tests :: Spec
1010tests = do