From d57c98798d53b0df53602bb7b3227067f4ac4f96 Mon Sep 17 00:00:00 2001 From: iko Date: Sat, 21 Sep 2019 17:39:41 +0300 Subject: [PATCH] Added stack (#2) * Added stack * Moved to hpack --- .gitignore | 53 +++------ LICENSE | 1 + package.yaml | 45 +++++++ semi-iso.cabal | 111 ++++++------------ {Control => src/Control}/Category/Reader.hs | 0 .../Control}/Category/Structures.hs | 0 .../Control}/Lens/Internal/SemiIso.hs | 0 {Control => src/Control}/Lens/SemiIso.hs | 0 {Control => src/Control}/SIArrow.hs | 0 {Control => src/Control}/Tuple/Morph.hs | 0 {Data => src/Data}/Profunctor/Exposed.hs | 0 stack.yaml | 69 +++++++++++ 12 files changed, 168 insertions(+), 111 deletions(-) create mode 100644 package.yaml rename {Control => src/Control}/Category/Reader.hs (100%) rename {Control => src/Control}/Category/Structures.hs (100%) rename {Control => src/Control}/Lens/Internal/SemiIso.hs (100%) rename {Control => src/Control}/Lens/SemiIso.hs (100%) rename {Control => src/Control}/SIArrow.hs (100%) rename {Control => src/Control}/Tuple/Morph.hs (100%) rename {Data => src/Data}/Profunctor/Exposed.hs (100%) create mode 100644 stack.yaml diff --git a/.gitignore b/.gitignore index 9292e2b..4c9e245 100644 --- a/.gitignore +++ b/.gitignore @@ -1,48 +1,23 @@ -# Created by https://www.gitignore.io - -### Haskell ### dist +dist-* cabal-dev *.o *.hi +*.hie *.chi *.chs.h -.virtualenv +*.dyn_o +*.dyn_hi +.hpc .hsenv .cabal-sandbox/ cabal.sandbox.config -cabal.config - - -### Emacs ### -# -*- mode: gitignore; -*- -*~ -\#*\# -/.emacs.desktop -/.emacs.desktop.lock -*.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 +*.prof +*.aux +*.hp +*.eventlog +.stack-work/ +cabal.project.local +cabal.project.local~ +.HTF/ +.ghc.environment.* diff --git a/LICENSE b/LICENSE index d57e6ec..d6a5f4f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ Copyright (c) 2014 Paweł Nowak +Copyright (c) 2019 Ilya Kostyuchenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/package.yaml b/package.yaml new file mode 100644 index 0000000..5b3e240 --- /dev/null +++ b/package.yaml @@ -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 + +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 diff --git a/semi-iso.cabal b/semi-iso.cabal index 3494076..046e655 100644 --- a/semi-iso.cabal +++ b/semi-iso.cabal @@ -1,77 +1,44 @@ -name: semi-iso -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@). +cabal-version: 1.12 - SIArrow abstracts categories of reversible computations (with reversible side effects). In - the case of parsing and pretty-printing using the "syntax" library if we have an arrow - @SIArrow cat => cat a b@ then we can: - . - * Evaluate it from left to right, turning a value of type @a@ into a value of type @b@, - with the side effect of consuming a sequence. (Parsing) - . - * Evaluate it from right to left, turning a value of type @b@ into a value of type @a@, - with the side effect of generating a sequence. (Pretty-printing) - . - In the particular case of parsing/pretty-printing the type @a@ will be usually @()@, e.g. - we just produce a value during parsing and just consume a value during pretty-printing. - To support this style we define a functor and applicative structure on @cat () b@, for example - '/*/' (equivalent of '<*>') has type @(\/*\/) :: SIArrow cat => cat () a -> cat () b -> cat () (a, b)@. - . - When more power then applicative is needed - for example when the syntax depends on the - parsed value - we turn back to arrow composition. - . - 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 -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 +-- This file has been generated from package.yaml by hpack version 0.31.2. +-- +-- see: https://github.com/sol/hpack +-- +-- hash: 9fe627e0673c25d1622d6bbc274fa58649b56cc4796f5b740e346f1496b40f1a + +name: semi-iso +version: 0.1.0.0 +description: Please see the README on GitHub at +homepage: https://github.com/ilyakooo0/semi-iso-optics#readme +bug-reports: https://github.com/ilyakooo0/semi-iso-optics/issues +author: Ilya Kostyuchenko +maintainer: ilyakooo0@gmail.com +copyright: 2019 Ilya Kostyuchenko, 2014 Paweł Nowak +license: MIT +license-file: LICENSE +build-type: Simple source-repository head - type: git - location: git@github.com:Pawel834/semi-iso.git + type: git + location: https://github.com/ilyakooo0/semi-iso-optics library - exposed-modules: Control.Lens.SemiIso - Control.Lens.Internal.SemiIso - Control.SIArrow - Control.Category.Reader - Control.Category.Structures - Data.Profunctor.Exposed - Control.Tuple.Morph - build-depends: base >= 4.9 && <4.13 - , profunctors == 5.* - , transformers - , lens == 4.* - , semigroupoids - default-language: Haskell2010 - ghc-options: -Wall + exposed-modules: + Control.Lens.SemiIso + Control.Lens.Internal.SemiIso + Control.SIArrow + Control.Category.Reader + Control.Category.Structures + Data.Profunctor.Exposed + other-modules: + Paths_semi_iso + hs-source-dirs: + src + ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wpartial-fields -Werror=missing-home-modules -Wmissing-home-modules -Widentities -Wredundant-constraints -Wmissing-export-lists + build-depends: + base >=4.7 && <5 + , lens + , profunctors + , semigroupoids + , transformers + default-language: Haskell2010 diff --git a/Control/Category/Reader.hs b/src/Control/Category/Reader.hs similarity index 100% rename from Control/Category/Reader.hs rename to src/Control/Category/Reader.hs diff --git a/Control/Category/Structures.hs b/src/Control/Category/Structures.hs similarity index 100% rename from Control/Category/Structures.hs rename to src/Control/Category/Structures.hs diff --git a/Control/Lens/Internal/SemiIso.hs b/src/Control/Lens/Internal/SemiIso.hs similarity index 100% rename from Control/Lens/Internal/SemiIso.hs rename to src/Control/Lens/Internal/SemiIso.hs diff --git a/Control/Lens/SemiIso.hs b/src/Control/Lens/SemiIso.hs similarity index 100% rename from Control/Lens/SemiIso.hs rename to src/Control/Lens/SemiIso.hs diff --git a/Control/SIArrow.hs b/src/Control/SIArrow.hs similarity index 100% rename from Control/SIArrow.hs rename to src/Control/SIArrow.hs diff --git a/Control/Tuple/Morph.hs b/src/Control/Tuple/Morph.hs similarity index 100% rename from Control/Tuple/Morph.hs rename to src/Control/Tuple/Morph.hs diff --git a/Data/Profunctor/Exposed.hs b/src/Data/Profunctor/Exposed.hs similarity index 100% rename from Data/Profunctor/Exposed.hs rename to src/Data/Profunctor/Exposed.hs diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..a264f96 --- /dev/null +++ b/stack.yaml @@ -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