-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c8c3daa
Showing
22 changed files
with
1,756 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize, opened, reopened] | ||
push: | ||
schedule: | ||
# additionally run once per week (At 00:00 on Sunday) to maintain cache | ||
- cron: '0 0 * * 0' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: ghc ${{ matrix.ghc }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# We must always use the latest version of cabal because | ||
# otherwise ghc-paths, which is a dependency of doctest, | ||
# can't be configured. | ||
cabal: ["3.10"] | ||
ghc: | ||
# Can't do earlier than 8.10 because we use unlifted newtypes | ||
# If we're willing to fudge that then maybe we can extend | ||
# the range of GHCs we support | ||
# - "8.6.5" | ||
# - "8.8.3" | ||
- "8.10.7" | ||
- "9.0.2" | ||
- "9.2.4" | ||
- "9.4.7" | ||
- "9.6.3" | ||
- "9.8.1" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: haskell-actions/[email protected] | ||
id: setup-haskell-cabal | ||
name: Setup Haskell | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: ${{ matrix.cabal }} | ||
|
||
- name: Configure | ||
run: | | ||
cabal configure --enable-tests --enable-benchmarks --enable-documentation --test-show-details=direct --write-ghc-environment-files=always | ||
- name: Freeze | ||
run: | | ||
cabal freeze | ||
- uses: actions/cache@v3 | ||
name: Cache ~/.cabal/3tore | ||
with: | ||
path: ~/.cabal/store | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
cabal build all --only-dependencies | ||
- name: Build | ||
run: | | ||
cabal build all | ||
# - name: Test | ||
# run: | | ||
# cabal test all | ||
|
||
# - name: Documentation | ||
# run: | | ||
# cabal haddock all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2024 Tom Ellis | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included | ||
in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Bluefin | ||
|
||
Bluefin is an effect system for Haskell which allows you, though | ||
value-level handles, to freely mix a variety of effects | ||
including | ||
|
||
* [`Bluefin.EarlyReturn`](bluefin/src/Bluefin/EarlyReturn.hs), for early return | ||
* [`Bluefin.Exception`](bluefin/src/Bluefin/Exception.hs), for exceptions | ||
* [`Bluefin.IO`](bluefin/src/Bluefin/IO.hs), for I/O | ||
* [`Bluefin.State`](bluefin/src/Bluefin/State.hs), for mutable state | ||
* [`Bluefin.Stream`](bluefin/src/Bluefin/Stream.hs), for streams | ||
|
||
## Introduction | ||
|
||
For an introduction to Bluefin, see the docs in the | ||
[`Bluefin`](bluefin/src/Bluefin.hs) module. | ||
|
||
## Acknowledgements | ||
|
||
Tom Ellis would like to thank many individuals for their work related | ||
to effect systems. Without the work of these individuals, Bluefin | ||
would not exist. | ||
|
||
* Oleg Kiselyov, particularly for his work on effects and delimited | ||
continuations | ||
|
||
* Michael Snoyman, particularly for his work on conduit and the | ||
`ReaderT` `IO` pattern | ||
|
||
* Gabriella Gonzalez, particularly for her work on pipes | ||
|
||
* Alexis King, particularly for her work on effect systems and delimited | ||
continuations | ||
|
||
* David Feuer, particularly for [his observation about handlers and | ||
rank-2 types]( | ||
https://www.reddit.com/r/haskell/comments/pywuqg/comment/hexo2uu/ | ||
|
||
* Andrzej Rybczak for his work on effectful | ||
|
||
* Francois Pottier for "Wandering through linear types, capabilities, | ||
and regions" | ||
<http://pauillac.inria.fr/~fpottier/slides/fpottier-2007-05-linear-bestiary.pdf> | ||
|
||
* Jasper van de Jeugt, particularly for promoting the handle pattern | ||
<https://jaspervdj.be/posts/2018-03-08-handle-pattern.html#fnref2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Important tasks | ||
|
||
* Benchmarks (against `effectful` particularly) | ||
|
||
* Doctests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.0.0.0 | ||
|
||
* Initial version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
cabal-version: 3.0 | ||
name: bluefin-internal | ||
version: 0.0.0.0 | ||
author: Tom Ellis | ||
maintainer: Tom Ellis | ||
|
||
extra-source-files: CHANGELOG.md | ||
|
||
common defaults | ||
ghc-options: -Wall | ||
default-extensions: | ||
-- GHC2021 | ||
BangPatterns | ||
BinaryLiterals | ||
ConstrainedClassMethods | ||
ConstraintKinds | ||
DeriveDataTypeable | ||
DeriveFoldable | ||
DeriveFunctor | ||
DeriveGeneric | ||
DeriveLift | ||
DeriveTraversable | ||
DoAndIfThenElse | ||
EmptyCase | ||
EmptyDataDecls | ||
EmptyDataDeriving | ||
ExistentialQuantification | ||
ExplicitForAll | ||
-- Not available until 9.2 | ||
-- FieldSelectors | ||
FlexibleContexts | ||
FlexibleInstances | ||
ForeignFunctionInterface | ||
GADTSyntax | ||
GeneralisedNewtypeDeriving | ||
HexFloatLiterals | ||
ImplicitPrelude | ||
-- Not available until 8.10 | ||
-- ImportQualifiedPost | ||
InstanceSigs | ||
KindSignatures | ||
MonomorphismRestriction | ||
MultiParamTypeClasses | ||
NamedFieldPuns | ||
NamedWildCards | ||
NumericUnderscores | ||
PatternGuards | ||
PolyKinds | ||
PostfixOperators | ||
RankNTypes | ||
RelaxedPolyRec | ||
ScopedTypeVariables | ||
StandaloneDeriving | ||
-- Not available in 8.6 | ||
-- StandaloneKindSignatures | ||
StarIsType | ||
TraditionalRecordSyntax | ||
TupleSections | ||
TypeApplications | ||
TypeOperators | ||
TypeSynonymInstances | ||
NoExplicitNamespaces | ||
-- Others | ||
DataKinds | ||
DerivingStrategies | ||
GADTs | ||
LambdaCase | ||
|
||
library | ||
import: defaults | ||
default-language: Haskell2010 | ||
hs-source-dirs: src | ||
build-depends: | ||
base >= 4.12 && < 4.20, | ||
unliftio-core < 0.3, | ||
transformers < 0.7, | ||
transformers-base < 0.5, | ||
monad-control < 1.1 | ||
ghc-options: -Wall | ||
exposed-modules: | ||
Bluefin.Internal, | ||
Bluefin.Internal.Examples | ||
|
||
test-suite bluefin-test | ||
import: defaults | ||
default-language: Haskell2010 | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: test | ||
main-is: Main.hs | ||
build-depends: | ||
base, | ||
bluefin-internal |
Oops, something went wrong.