Commit dc7a9556 authored by root's avatar root
Browse files

Initial commit - v0.0.1.0

parents
.stack-work/
*~
\ No newline at end of file
image: nixos/nix:latest
before_script:
- export LC_ALL=C.UTF-8
- nix-env -iA nixpkgs.stack
- nix-env -iA nixpkgs.hlint
stages:
- lint
- build
lint:
stage: lint
script:
- hlint .
build:
stage: build
script:
- stack --nix build --ghc-options "-Wall -Werror"
# Changelog for polysemy-path
## v0.0.1.0
* Add polysemy versions of parsing functions and `stripProperPrefix`.
Copyright Daniel Firth (c) 2020
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Author name here nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# polysemy-path
Polysemy-ready versions of functions from the `path` library.
name: polysemy-path
version: 0.0.1.0
git: https://gitlab.com/homotopic-tech/polysemy-path
license: MIT
author: "Daniel Firth"
maintainer: "dan.firth@homotopic.tech"
copyright: "2020 Daniel Firth"
extra-source-files:
- README.md
- ChangeLog.md
synopsis: Polysemy versions of Path functions.
category: Polysemy
dependencies:
- base >= 4.7 && < 5
- path
- polysemy
- polysemy-plugin
- polysemy-zoo
library:
source-dirs: src
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.34.2.
--
-- see: https://github.com/sol/hpack
name: polysemy-path
version: 0.1.0.1
synopsis: Polysemy versions of Path functions.
category: Polysemy
author: Daniel Firth
maintainer: dan.firth@homotopic.tech
copyright: 2020 Daniel Firth
license: MIT
license-file: LICENSE
build-type: Simple
extra-source-files:
README.md
ChangeLog.md
source-repository head
type: git
location: https://gitlab.com/homotopic-tech/polysemy-path
library
exposed-modules:
Polysemy.Path
other-modules:
Paths_polysemy_path
hs-source-dirs:
src
build-depends:
base >=4.7 && <5
, path
, polysemy
, polysemy-plugin
, polysemy-zoo
default-language: Haskell2010
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fplugin=Polysemy.Plugin #-}
module Polysemy.Path where
import Control.Monad
import Path
import Polysemy
import Polysemy.ConstraintAbsorber.MonadCatch
import Polysemy.Error
parseRelFile' :: Members '[Error SomeException] r
=> FilePath
-> Sem r (Path Rel File)
parseRelFile' x = absorbMonadThrow (try . parseRelFile $ x) >>= either throw return
parseAbsFile' :: Members '[Error SomeException] r
=> FilePath
-> Sem r (Path Abs File)
parseAbsFile' x = absorbMonadThrow (try . parseAbsFile $ x) >>= either throw return
parseRelDir' :: Members '[Error SomeException] r
=> FilePath
-> Sem r (Path Rel Dir)
parseRelDir' x = absorbMonadThrow (try . parseRelDir $ x) >>= either throw return
parseAbsDir' :: Members '[Error SomeException] r
=> FilePath
-> Sem r (Path Abs Dir)
parseAbsDir' x = absorbMonadThrow (try . parseAbsDir $ x) >>= either throw return
stripProperPrefix' :: Members '[Error SomeException] r
=> Path b Dir
-> Path b t
-> Sem r (Path Rel t)
stripProperPrefix' x y = absorbMonadThrow (try $ stripProperPrefix x y) >>= either throw return
resolver: nightly-2020-10-29
packages:
- .
extra-deps:
- compact-0.2.0.0
- polysemy-plugin-0.2.5.1
- polysemy-zoo-0.7.0.1
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages:
- completed:
hackage: compact-0.2.0.0@sha256:9c5785bdc178ea6cf8f514ad35a78c64220e3cdb22216534e4cf496765551c7e,2345
pantry-tree:
size: 546
sha256: 6f7da573fbcddc109e1521edc07f1b34d7506473a3930074453e829daf901d71
original:
hackage: compact-0.2.0.0
- completed:
hackage: polysemy-plugin-0.2.5.1@sha256:61c6c0aad2852377aa5d5a8f9639a437905e3a6f0e2a99a41e96fb231dc86836,2952
pantry-tree:
size: 1232
sha256: 9720d9a1675c7ac3e2635b8c9f002f7ab0764eb60738a3405603cb33bdffc493
original:
hackage: polysemy-plugin-0.2.5.1
- completed:
hackage: polysemy-zoo-0.7.0.1@sha256:60c2921df95f61d43222a75adde4f330e9510320b416132838a354cd81b4bcc5,3846
pantry-tree:
size: 2979
sha256: af39e295a7831e6bca01fa78df6c538cb6f1dfb339d118056fd0d9c314925726
original:
hackage: polysemy-zoo-0.7.0.1
snapshots:
- completed:
size: 543560
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2020/10/29.yaml
sha256: c8101bf4e679881fd9a6c8dcbdfc9586e119bdb2aad401f5c7e9bc0f8dac5622
original: nightly-2020-10-29
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment