Skip to content

Commit c9defd5

Browse files
committed
Cosmetic changes for publishing in Hackage
1 parent d0dad49 commit c9defd5

File tree

5 files changed

+123
-100
lines changed

5 files changed

+123
-100
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.direnv
22

33
.devenv
4-
dist-newstyle
4+
dist-newstyle
5+
.vscode

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h1 align="center">Cuddle</h1>
22

3-
Cuddle is a library for generating and manipulating [CDDL](https://datatracker.ietf.org/doc/html/rfc8610).
3+
Cuddle is a library for generating and manipulating [CDDL](https://datatracker.ietf.org/doc/html/rfc8610).
44

55
<p align="center">
66
<a href="https://github.com/input-output-hk/cuddle/actions/workflows/ci.yml">
@@ -27,7 +27,7 @@ Cuddle currently supports the following CDDL features:
2727
### Partial support
2828

2929
- Representation types
30-
- Representation types are correctly parsed and formatted, but only certain
30+
- Representation types are correctly parsed and formatted, but only certain
3131
types are understood in CBOR generation.
3232
- Cuts
3333
- Cut syntax is parsed and formatted, but ignored for CBOR generation.
@@ -46,27 +46,28 @@ Cuddle currently supports the following CDDL features:
4646
## The cuddle tool
4747

4848
Included in this package is a command line tool for working with CDDL files. It
49-
currently supports three functions:
49+
currently supports four functions:
5050

5151
- Formatting of CDDL files
5252
- Validating that a CDDL file is legal
53-
- Generating random CBOR terms matching CDDL productions.
53+
- Generating random CBOR terms matching CDDL productions
54+
- Testing compliance of a CBOR file against a CDDL spec.
5455

5556
# Huddle
5657

57-
One of the principal features of Cuddle is the ability to define your CDDL in a
58+
One of the principal features of Cuddle is the ability to define your CDDL in a
5859
Haskell DSL, called Huddle. This offers the following benefits:
5960

60-
- Ability to use Haskell's abstraction facilities to define more complex CDDL
61+
- Ability to use Haskell's abstraction facilities to define more complex CDDL
6162
constructions.
6263
- Some measure of compile-time safety for your CDDL. Attempting to reference
6364
an undefined identifier will be a compile-time error, for example.
6465
- The ability to modularise your configuration. CDDL lacks any real facility
6566
for splitting a CDDL spec amongst multiple files. We solve this instead using
6667
Haskell's module system.
6768

68-
Obviously, this comes with the downside of needing to sensibly mesh the
69-
different abstraction facilities offered by Haskell and CDDL. We have tried to
69+
Obviously, this comes with the downside of needing to sensibly mesh the
70+
different abstraction facilities offered by Haskell and CDDL. We have tried to
7071
find a balance where the Huddle code roughly matches the CDDL but gains many
7172
of the advantages of writing in Haskell.
7273

cuddle.cabal

Lines changed: 112 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,55 @@
1-
cabal-version: 3.4
2-
name: cuddle
3-
version: 0.5.0.0
4-
synopsis: CDDL Generator and test utilities
5-
6-
-- description:
7-
license: Apache-2.0
8-
license-file: LICENSE
9-
author: IOG Ledger Team
10-
maintainer: [email protected]
11-
12-
-- copyright:
13-
category: Codec
14-
build-type: Simple
1+
cabal-version: 3.4
2+
name: cuddle
3+
version: 0.5.0.0
4+
synopsis: CDDL Generator and test utilities
5+
description:
6+
Cuddle is a library for generating and manipulating [CDDL](https://datatracker.ietf.org/doc/html/rfc8610).
7+
8+
Included in this package is a command line tool for working with CDDL files. It
9+
currently supports four functions:
10+
11+
- Formatting of CDDL files
12+
- Validating that a CDDL file is legal
13+
- Generating random CBOR terms matching CDDL productions
14+
- Testing compliance of a CBOR file against a CDDL spec.
15+
16+
license: Apache-2.0
17+
license-file: LICENSE
18+
author: IOG Ledger Team
19+
20+
copyright: 2025 Input Output Global Inc (IOG)
21+
category: Codec
22+
build-type: Simple
1523
extra-doc-files: CHANGELOG.md
24+
tested-with: ghc =={9.6, 9.8, 9.10, 9.12}
1625

17-
-- extra-source-files:
26+
source-repository head
27+
type: git
28+
location: https://github.com/input-output-hk/cuddle
29+
30+
source-repository this
31+
type: git
32+
location: https://github.com/input-output-hk/cuddle
33+
tag: cuddle-0.5.0.0
34+
35+
flag example
36+
description: Enable the example executable
37+
manual: True
38+
default: False
1839

1940
common warnings
20-
ghc-options: -Wall -Werror
41+
ghc-options:
42+
-Wall
43+
-Werror
2144

2245
library
23-
import: warnings
46+
import: warnings
2447
exposed-modules:
2548
Codec.CBOR.Cuddle.CBOR.Gen
2649
Codec.CBOR.Cuddle.CBOR.Validator
2750
Codec.CBOR.Cuddle.CDDL
28-
Codec.CBOR.Cuddle.CDDL.CtlOp
2951
Codec.CBOR.Cuddle.CDDL.CTree
52+
Codec.CBOR.Cuddle.CDDL.CtlOp
3053
Codec.CBOR.Cuddle.CDDL.Postlude
3154
Codec.CBOR.Cuddle.CDDL.Prelude
3255
Codec.CBOR.Cuddle.CDDL.Resolve
@@ -40,75 +63,77 @@ library
4063
Codec.CBOR.Cuddle.Pretty.Columnar
4164
Codec.CBOR.Cuddle.Pretty.Utils
4265

43-
other-modules:
44-
45-
-- other-extensions:
4666
build-depends:
47-
, base >=4.18.2.1
48-
, base16-bytestring
49-
, boxes
50-
, bytestring
51-
, capability
52-
, cborg
53-
, containers
54-
, data-default-class
55-
, foldable1-classes-compat
56-
, generic-optics
57-
, regex-tdfa
58-
, hashable
59-
, megaparsec
60-
, mtl
61-
, mutable-containers
62-
, optics-core
63-
, ordered-containers
64-
, parser-combinators
65-
, prettyprinter
66-
, random <1.3
67-
, scientific
68-
, text
69-
, tree-diff
70-
71-
hs-source-dirs: src
67+
base >=4.18 && <4.22,
68+
base16-bytestring ^>=1.0.2,
69+
boxes ^>=0.1.5,
70+
bytestring >=0.11.4 && <0.13,
71+
capability ^>=0.5,
72+
cborg ^>=0.2.10,
73+
containers >=0.6.7 && <0.8,
74+
data-default-class ^>=0.2,
75+
foldable1-classes-compat ^>=0.1.1,
76+
generic-optics ^>=2.2.1,
77+
hashable ^>=1.5,
78+
megaparsec ^>=9.7,
79+
mtl ^>=2.3.1,
80+
mutable-containers ^>=0.3.4,
81+
optics-core ^>=0.4.1,
82+
ordered-containers ^>=0.2.4,
83+
parser-combinators ^>=1.3,
84+
prettyprinter ^>=1.7.1,
85+
random <1.3,
86+
regex-tdfa ^>=1.3.2,
87+
scientific ^>=0.3.8,
88+
text >=2.0.2 && <2.2,
89+
tree-diff ^>=0.3.4,
90+
91+
hs-source-dirs: src
7292
default-language: GHC2021
7393

7494
executable example
75-
import: warnings
95+
import: warnings
96+
97+
if flag(example)
98+
buildable: True
99+
else
100+
buildable: False
101+
76102
default-language: GHC2021
77103
other-modules:
78104
Conway
79105
Monad
80106

81-
-- other-extensions:
82-
hs-source-dirs: example
83-
main-is: Main.hs
107+
hs-source-dirs: example
108+
main-is: Main.hs
84109
build-depends:
85-
, base >=4.14.0.0
86-
, cuddle
87-
, megaparsec
88-
, prettyprinter
89-
, random
90-
, text
110+
base,
111+
cuddle,
112+
megaparsec,
113+
prettyprinter,
114+
random,
115+
text,
91116

92117
executable cuddle
93-
import: warnings
118+
import: warnings
94119
default-language: GHC2021
95-
hs-source-dirs: ./bin/
96-
main-is: Main.hs
120+
hs-source-dirs: ./bin/
121+
main-is: Main.hs
97122
build-depends:
98-
, base >=4.14.0.0
99-
, base16-bytestring
100-
, bytestring
101-
, cborg
102-
, cuddle
103-
, megaparsec
104-
, optparse-applicative
105-
, prettyprinter
106-
, random
107-
, mtl
108-
, text
123+
base,
124+
base16-bytestring,
125+
bytestring,
126+
cborg,
127+
cuddle,
128+
megaparsec,
129+
mtl,
130+
optparse-applicative,
131+
prettyprinter,
132+
random,
133+
text,
109134

110135
test-suite cuddle-test
111-
import: warnings
136+
import: warnings
112137
default-language: GHC2021
113138
other-modules:
114139
Test.Codec.CBOR.Cuddle.CDDL.Examples
@@ -117,21 +142,20 @@ test-suite cuddle-test
117142
Test.Codec.CBOR.Cuddle.CDDL.Pretty
118143
Test.Codec.CBOR.Cuddle.Huddle
119144

120-
-- other-extensions:
121-
type: exitcode-stdio-1.0
122-
hs-source-dirs: test
123-
main-is: Main.hs
145+
type: exitcode-stdio-1.0
146+
hs-source-dirs: test
147+
main-is: Main.hs
124148
build-depends:
125-
, base >=4.14.0.0
126-
, bytestring
127-
, cuddle
128-
, data-default-class
129-
, hspec
130-
, hspec-megaparsec
131-
, HUnit
132-
, megaparsec
133-
, prettyprinter
134-
, string-qq
135-
, QuickCheck
136-
, text
137-
, tree-diff
149+
HUnit ^>=1.6.2,
150+
QuickCheck ^>=2.15,
151+
base,
152+
bytestring,
153+
cuddle,
154+
data-default-class,
155+
hspec ^>=2.11,
156+
hspec-megaparsec ^>=2.2,
157+
megaparsec,
158+
prettyprinter,
159+
string-qq ^>=0.0.6,
160+
text,
161+
tree-diff,

noindex.cache

-24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)