Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,18 @@ jobs:
build:
strategy:
matrix:
ghc: ['9.0.2', '9.2.7', '9.4.4', '9.6.1']
cabal: ['3.4.1.0', '3.6.2.0', '3.8.1.0', '3.10.1.0']
os: ['ubuntu-latest', 'macos-latest']
exclude:
# Cabal 3.4.1.0 supports GHC version < 9.1
- cabal: '3.4.1.0'
ghc: '9.2.7'
- cabal: '3.4.1.0'
ghc: '9.4.4'
- cabal: '3.4.1.0'
ghc: '9.6.1'
# Cabal 3.6.2.0 supports GHC version < 9.4
- cabal: '3.6.2.0'
ghc: '9.4.4'
- cabal: '3.6.2.0'
ghc: '9.6.1'
ghc: ['9.0.2', '9.2.8', '9.4.8', '9.6.7', '9.8.4', '9.10.3']
cabal: ['3.10.2.0', '3.12.1.0', '3.14.2.0', '3.16.1.0']
os: ['ubuntu-latest']
runs-on: ${{ matrix.os }}
name: platform ${{ matrix.os }} GHC ${{ matrix.ghc }} cabal ${{ matrix.cabal }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Setup Haskell
id: setup-haskell
uses: haskell/actions/setup@v2
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
Expand All @@ -49,9 +36,6 @@ jobs:
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-

- name: Update cabal package list
run: cabal update

- name: Build dependencies
run: cabal build --only-dependencies

Expand All @@ -65,7 +49,6 @@ jobs:
run: cabal test --index-state HEAD

- name: Test on oldest dependencies
if: matrix.cabal == '3.10.1.0'
run: cabal test --prefer-oldest

format:
Expand All @@ -75,4 +58,6 @@ jobs:
uses: actions/checkout@v3

- name: Check code formatting
uses: fourmolu/fourmolu-action@v6
uses: haskell-actions/run-fourmolu@v12
with:
version: "0.19.0.1"
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
index-state: 2023-03-14T09:58:19Z
index-state: 2026-04-09T08:51:20Z
packages: *.cabal
write-ghc-environment-files: always
tests: True
45 changes: 23 additions & 22 deletions crem.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.0

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

Expand All @@ -19,21 +19,18 @@ license-file: LICENSE
build-type: Simple
tested-with:
GHC ==9.0.2
, GHC ==9.2.7
, GHC ==9.4.4
, GHC ==9.6.1
, GHC ==9.2.8
, GHC ==9.4.8
, GHC ==9.6.7
, GHC ==9.8.4
, GHC ==9.10.3
extra-source-files:
README.md
CHANGELOG.md

flag errors
description: enable -Werror
manual: True
default: False

flag test-doctest
description: run doctests
manual: True
default: True

library
Expand All @@ -52,14 +49,15 @@ library
DerivingStrategies
LambdaCase
PackageImports
RoleAnnotations
ghc-options: -Weverything -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations -Wno-prepositive-qualified-module
build-depends:
base >=4.15 && <4.19
base >=4.15 && <4.21
, machines >=0.7.3 && <0.8
, nothunks >=0.1 && <0.4
, profunctors >=3.2 && <5.7
, singletons-base >=3.0 && <3.3
, text >=1.2 && <2.1
, singletons-base >=3.0 && <3.5
, text >=1.2 && <2.2
default-language: Haskell2010
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
Expand Down Expand Up @@ -142,9 +140,10 @@ library crem-examples
DerivingStrategies
LambdaCase
PackageImports
RoleAnnotations
ghc-options: -Weverything -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations -Wno-prepositive-qualified-module
build-depends:
base >=4.15 && <4.19
base >=4.15 && <4.21
, crem
, profunctors
, singletons-base
Expand Down Expand Up @@ -211,9 +210,10 @@ executable hobbit-game
DerivingStrategies
LambdaCase
PackageImports
RoleAnnotations
ghc-options: -Weverything -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations -Wno-prepositive-qualified-module
build-depends:
base >=4.15 && <4.19
base >=4.15 && <4.21
, crem
, crem-examples
default-language: Haskell2010
Expand Down Expand Up @@ -278,9 +278,10 @@ executable hobbit-map
DerivingStrategies
LambdaCase
PackageImports
RoleAnnotations
ghc-options: -Weverything -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations -Wno-prepositive-qualified-module
build-depends:
base >=4.15 && <4.19
base >=4.15 && <4.21
, crem
, crem-examples
, text
Expand Down Expand Up @@ -347,12 +348,15 @@ test-suite crem-doctests
DerivingStrategies
LambdaCase
PackageImports
RoleAnnotations
ghc-options: -Weverything -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations -Wno-prepositive-qualified-module -threaded -Wno-unused-packages
build-depends:
base >=4.15 && <4.19
Cabal
, base >=4.15 && <4.21
, crem
, crem-examples
, doctest-parallel >=0.2.3 && <0.4
, doctest-parallel >=0.2.3 && <0.5
, ghc
default-language: Haskell2010
if impl(ghc >= 9.2)
ghc-options: -Wno-missing-kind-signatures
Expand Down Expand Up @@ -406,10 +410,6 @@ test-suite crem-doctests
TypeSynonymInstances
if flag(errors)
ghc-options: -Werror
if flag(test-doctest)
buildable: True
else
buildable: False

test-suite crem-spec
type: exitcode-stdio-1.0
Expand All @@ -427,11 +427,12 @@ test-suite crem-spec
DerivingStrategies
LambdaCase
PackageImports
RoleAnnotations
ghc-options: -Weverything -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations -Wno-prepositive-qualified-module
build-tool-depends:
hspec-discover:hspec-discover
build-depends:
base >=4.15 && <4.19
base >=4.15 && <4.21
, crem
, crem-examples
, hspec >=2.7 && <2.12
Expand Down
12 changes: 12 additions & 0 deletions decision-log/2026-04-09-renounce-literate-haskell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: renounce literate Haskell
date: 2026-04-09
context: >
Currently we are using literate Haskell for one example where the comments take the most part of the file.

This always created issues with `doctest-parallel` execution, since the library is not able to parse literate Haskell files.

Moreover, lately we found that, when trying to use CPP conditionals inside a literate Haskell files, then it fails to compile.
decision: >
We decide to renounce literate Haskell, since it is creating more issues that the value it is providing
consequences: >
We `unlit` the literate Haskell file, and we turn it into a normal Haskell module with a lot of comments
19 changes: 19 additions & 0 deletions decision-log/2026-04-10-remove-macos-from-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: remove macos from ci
date: 2026-04-10
context: >
With the support for GHC 9.10 and newer cabal versions, we stumbled into an issue with respect to builds with `macos` machines.

The issue present itself as follows, during `cabal build`:

```
<no location info>: error:
Warning: Couldn't figure out LLVM version!
Make sure you have installed LLVM between [9 and 13)
ghc-9.0.2: could not execute: opt
```

I tried applying the suggestions frm https://discourse.haskell.org/t/cabal-and-llvm-issue/3672 but was not able to solve the issue.
decision: >
For the moment the decision is to remove `macos` machines from CI and hide the issue under the carpet.
consequences: >
I will create an issue about this if someone more knowledgeable than me wants to fix this.
39 changes: 24 additions & 15 deletions examples/Crem/Example/Cart/Aggregate.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wmissing-deriving-strategies
{-# OPTIONS_GHC -Wno-missing-deriving-strategies #-}

#if __GLASGOW_HASKELL__ >= 908
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag-Wmissing-poly-kind-signatures
{-# OPTIONS_GHC -Wno-missing-poly-kind-signatures #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag-Wmissing-role-annotations
{-# OPTIONS_GHC -Wno-missing-role-annotations #-}
#endif

-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wunticked-promoted-constructors
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wunused-type-patterns
Expand All @@ -20,21 +29,21 @@ import Crem.Topology
import "singletons-base" Data.Singletons.Base.TH

$( singletons
[d|
data CartVertex
= WaitingForPayment
| InitiatingPayment
| PaymentComplete
deriving stock (Eq, Show, Enum, Bounded)

cartTopology :: Topology CartVertex
cartTopology =
Topology
[ (WaitingForPayment, [InitiatingPayment])
, (InitiatingPayment, [PaymentComplete])
, (PaymentComplete, [])
]
|]
[d|
data CartVertex
= WaitingForPayment
| InitiatingPayment
| PaymentComplete
deriving stock (Eq, Show, Enum, Bounded)

cartTopology :: Topology CartVertex
cartTopology =
Topology
[ (WaitingForPayment, [InitiatingPayment])
, (InitiatingPayment, [PaymentComplete])
, (PaymentComplete, [])
]
|]
)

deriving via AllVertices CartVertex instance RenderableVertices CartVertex
Expand Down
21 changes: 15 additions & 6 deletions examples/Crem/Example/Cart/Shipping.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wmissing-deriving-strategies
{-# OPTIONS_GHC -Wno-missing-deriving-strategies #-}

#if __GLASGOW_HASKELL__ >= 908
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag-Wmissing-poly-kind-signatures
{-# OPTIONS_GHC -Wno-missing-poly-kind-signatures #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag-Wmissing-role-annotations
{-# OPTIONS_GHC -Wno-missing-role-annotations #-}
#endif

-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wredundant-constraints
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wunticked-promoted-constructors
Expand All @@ -31,13 +40,13 @@ data ShippingCommand
data ShippingEvent

$( singletons
[d|
data ShippingVertex = ShippingVertex
deriving stock (Eq, Show, Enum, Bounded)
[d|
data ShippingVertex = ShippingVertex
deriving stock (Eq, Show, Enum, Bounded)

shippingTopology :: Topology ShippingVertex
shippingTopology = Topology []
|]
shippingTopology :: Topology ShippingVertex
shippingTopology = Topology []
|]
)

deriving via AllVertices ShippingVertex instance RenderableVertices ShippingVertex
Expand Down
37 changes: 23 additions & 14 deletions examples/Crem/Example/LockDoor.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE TemplateHaskell #-}
Expand All @@ -7,6 +8,14 @@
{-# OPTIONS_GHC -Wno-all-missed-specialisations #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wmissing-deriving-strategies
{-# OPTIONS_GHC -Wno-missing-deriving-strategies #-}

#if __GLASGOW_HASKELL__ >= 908
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag-Wmissing-poly-kind-signatures
{-# OPTIONS_GHC -Wno-missing-poly-kind-signatures #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag-Wmissing-role-annotations
{-# OPTIONS_GHC -Wno-missing-role-annotations #-}
#endif

-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wunticked-promoted-constructors
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
-- https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wunused-type-patterns
Expand All @@ -20,21 +29,21 @@ import Crem.Topology
import "singletons-base" Data.Singletons.Base.TH

$( singletons
[d|
data LockDoorVertex
= IsLockOpen
| IsLockClosed
| IsLockLocked
deriving stock (Eq, Show, Enum, Bounded)
[d|
data LockDoorVertex
= IsLockOpen
| IsLockClosed
| IsLockLocked
deriving stock (Eq, Show, Enum, Bounded)

lockDoorTopology :: Topology LockDoorVertex
lockDoorTopology =
Topology
[ (IsLockOpen, [IsLockClosed])
, (IsLockClosed, [IsLockOpen, IsLockLocked])
, (IsLockLocked, [IsLockClosed])
]
|]
lockDoorTopology :: Topology LockDoorVertex
lockDoorTopology =
Topology
[ (IsLockOpen, [IsLockClosed])
, (IsLockClosed, [IsLockOpen, IsLockLocked])
, (IsLockLocked, [IsLockClosed])
]
|]
)

deriving via AllVertices LockDoorVertex instance RenderableVertices LockDoorVertex
Expand Down
Loading
Loading