Skip to content

Commit 3c61fa7

Browse files
committed
added exercise for Unit of success exercise in parsers chapter (24)
1 parent 789c406 commit 3c61fa7

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Revision history for unit-of-success
2+
3+
## 0.1.0.0 -- YYYY-mm-dd
4+
5+
* First version. Released on an unsuspecting world.

chapter24/unit_of_success/LICENSE

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright (c) 2018, Mukesh Soni
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of Mukesh Soni nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

chapter24/unit_of_success/Main.hs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Main where
2+
3+
import Text.Trifecta
4+
5+
parseIntegerTillEnd :: Parser Integer
6+
parseIntegerTillEnd = do
7+
i <- integer
8+
eof
9+
return i

chapter24/unit_of_success/Setup.hs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
-- Initial unit-of-success.cabal generated by cabal init. For further
2+
-- documentation, see http://haskell.org/cabal/users-guide/
3+
4+
name: unit-of-success
5+
version: 0.1.0.0
6+
-- synopsis:
7+
-- description:
8+
license: BSD3
9+
license-file: LICENSE
10+
author: Mukesh Soni
11+
maintainer: [email protected]
12+
-- copyright:
13+
-- category:
14+
build-type: Simple
15+
extra-source-files: ChangeLog.md
16+
cabal-version: >=1.10
17+
18+
library
19+
exposed-modules: Main
20+
-- other-modules:
21+
-- other-extensions:
22+
build-depends: trifecta, base >=4.11 && <4.12
23+
-- hs-source-dirs:
24+
default-language: Haskell2010

0 commit comments

Comments
 (0)