Added stack (#2)

* Added stack

* Moved to hpack
This commit is contained in:
iko 2019-09-21 17:39:41 +03:00 committed by GitHub
parent 3344a29fdc
commit d57c98798d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 168 additions and 111 deletions

53
.gitignore vendored
View File

@ -1,48 +1,23 @@
# Created by https://www.gitignore.io
### Haskell ###
dist dist
dist-*
cabal-dev cabal-dev
*.o *.o
*.hi *.hi
*.hie
*.chi *.chi
*.chs.h *.chs.h
.virtualenv *.dyn_o
*.dyn_hi
.hpc
.hsenv .hsenv
.cabal-sandbox/ .cabal-sandbox/
cabal.sandbox.config cabal.sandbox.config
cabal.config *.prof
*.aux
*.hp
### Emacs ### *.eventlog
# -*- mode: gitignore; -*- .stack-work/
*~ cabal.project.local
\#*\# cabal.project.local~
/.emacs.desktop .HTF/
/.emacs.desktop.lock .ghc.environment.*
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
.stack-work

View File

@ -1,4 +1,5 @@
Copyright (c) 2014 Paweł Nowak Copyright (c) 2014 Paweł Nowak
Copyright (c) 2019 Ilya Kostyuchenko
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the

45
package.yaml Normal file
View File

@ -0,0 +1,45 @@
name: semi-iso
version: 0.1.0.0
github: "ilyakooo0/semi-iso-optics"
license: MIT
author: "Ilya Kostyuchenko"
maintainer: "ilyakooo0@gmail.com"
copyright: "2019 Ilya Kostyuchenko, 2014 Paweł Nowak"
extra-source-files: []
# Metadata used when publishing your package
# synopsis: Short description of your package
# category: Web
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/ilyakooo0/semi-iso-optics#readme>
dependencies:
- base >= 4.7 && < 5
- profunctors
- transformers
- lens
- semigroupoids
library:
source-dirs: src
exposed-modules:
- Control.Lens.SemiIso
- Control.Lens.Internal.SemiIso
- Control.SIArrow
- Control.Category.Reader
- Control.Category.Structures
- Data.Profunctor.Exposed
ghc-options:
- -Wall
- -Wincomplete-uni-patterns
- -Wincomplete-record-updates
- -Wpartial-fields
- -Werror=missing-home-modules
- -Wmissing-home-modules
- -Widentities
- -Wredundant-constraints
- -Wmissing-export-lists

View File

@ -1,77 +1,44 @@
name: semi-iso cabal-version: 1.12
version: 1.0.0.0
synopsis: Weakened partial isomorphisms, reversible computations.
description:
Semi-isomorphisms are partial isomorphisms with weakened iso laws. They are a basic
building block of reversible computations. And they work with Iso and Prism from @lens@!
.
The module "Control.Lens.SemiIso" defines semi-isomorphisms and provides some
basic semi-isos and combinators. A @SemiIso' a b@ can be applied in both directions
to get a @a -> Either String b@ and @b -> Either String a@. SemiIsos can be composed
with Isos and Prisms (to get another SemiIso). Isos and Prisms can be directly
used as SemiIsos.
.
Semi-isomorphisms obey weaker laws then isomorphisms. We require only
.
> apply f >=> unapply f >=> apply f = apply f
> unapply f >=> apply f >=> unapply f = unapply f
.
instead of
.
> apply f >=> unapply f = f
> unapply f >=> apply f = f
.
Modules "Control.SIArrow" and "Control.Category.Structures" define an @Arrow@-like class
hierarchy. Unfortunately "Control.Arrow" cannot be used, as it is too restrictive (the
dreaded @arr@).
SIArrow abstracts categories of reversible computations (with reversible side effects). In -- This file has been generated from package.yaml by hpack version 0.31.2.
the case of parsing and pretty-printing using the "syntax" library if we have an arrow --
@SIArrow cat => cat a b@ then we can: -- see: https://github.com/sol/hpack
. --
* Evaluate it from left to right, turning a value of type @a@ into a value of type @b@, -- hash: 9fe627e0673c25d1622d6bbc274fa58649b56cc4796f5b740e346f1496b40f1a
with the side effect of consuming a sequence. (Parsing)
. name: semi-iso
* Evaluate it from right to left, turning a value of type @b@ into a value of type @a@, version: 0.1.0.0
with the side effect of generating a sequence. (Pretty-printing) description: Please see the README on GitHub at <https://github.com/ilyakooo0/semi-iso-optics#readme>
. homepage: https://github.com/ilyakooo0/semi-iso-optics#readme
In the particular case of parsing/pretty-printing the type @a@ will be usually @()@, e.g. bug-reports: https://github.com/ilyakooo0/semi-iso-optics/issues
we just produce a value during parsing and just consume a value during pretty-printing. author: Ilya Kostyuchenko
To support this style we define a functor and applicative structure on @cat () b@, for example maintainer: ilyakooo0@gmail.com
'/*/' (equivalent of '<*>') has type @(\/*\/) :: SIArrow cat => cat () a -> cat () b -> cat () (a, b)@. copyright: 2019 Ilya Kostyuchenko, 2014 Paweł Nowak
. license: MIT
When more power then applicative is needed - for example when the syntax depends on the license-file: LICENSE
parsed value - we turn back to arrow composition. build-type: Simple
.
Module "Control.Category.Reader" defines a Reader category transformer. It is like a monad
transformer, but for categories. The next version will include some more transformers and
mtl-style classes.
license: MIT
license-file: LICENSE
author: Paweł Nowak
maintainer: Paweł Nowak <pawel834@gmail.com>
copyright: Paweł Nowak 2014
category: Control, Data
build-type: Simple
cabal-version: >=1.11
Tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.1
source-repository head source-repository head
type: git type: git
location: git@github.com:Pawel834/semi-iso.git location: https://github.com/ilyakooo0/semi-iso-optics
library library
exposed-modules: Control.Lens.SemiIso exposed-modules:
Control.Lens.Internal.SemiIso Control.Lens.SemiIso
Control.SIArrow Control.Lens.Internal.SemiIso
Control.Category.Reader Control.SIArrow
Control.Category.Structures Control.Category.Reader
Data.Profunctor.Exposed Control.Category.Structures
Control.Tuple.Morph Data.Profunctor.Exposed
build-depends: base >= 4.9 && <4.13 other-modules:
, profunctors == 5.* Paths_semi_iso
, transformers hs-source-dirs:
, lens == 4.* src
, semigroupoids ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wpartial-fields -Werror=missing-home-modules -Wmissing-home-modules -Widentities -Wredundant-constraints -Wmissing-export-lists
default-language: Haskell2010 build-depends:
ghc-options: -Wall base >=4.7 && <5
, lens
, profunctors
, semigroupoids
, transformers
default-language: Haskell2010

69
stack.yaml Normal file
View File

@ -0,0 +1,69 @@
# This file was automatically generated by 'stack init'
#
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# https://docs.haskellstack.org/en/stable/yaml_configuration/
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
#
# resolver: lts-3.5
# resolver: nightly-2015-09-21
# resolver: ghc-7.10.2
#
# The location of a snapshot can be provided as a file or url. Stack assumes
# a snapshot provided as a file might change, whereas a url resource does not.
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-14.6
# User packages to be built.
# Various formats can be used as shown in the example below.
#
# packages:
# - some-directory
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
# subdirs:
# - auto-update
# - wai
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver.
# These entries can reference officially published versions as well as
# forks / in-progress versions pinned to a git hash. For example:
#
# extra-deps:
# - acme-missiles-0.3
# - git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
#
# extra-deps: []
# Override default flag values for local packages and extra-deps
# flags: {}
# Extra package databases containing global packages
# extra-package-dbs: []
# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=2.1"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor
ghc-options:
"$locals": -ddump-to-file -ddump-hi -fwarn-unused-binds -fwarn-unused-imports