Skip to content

Commit 28518ad

Browse files
committed
Initial import
0 parents  commit 28518ad

26 files changed

+14285
-0
lines changed

.envrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- sh -*-
2+
3+
# Use nixpkgs from nix/sources.json:
4+
if type jq &>/dev/null; then
5+
nixpkgs=$(jq --raw-output .nixpkgs.url nix/sources.json)
6+
export NIX_PATH=nixpkgs="$nixpkgs"
7+
fi
8+
9+
# Load in the shell.nix file:
10+
if type lorri &>/dev/null; then
11+
eval "$(lorri direnv)"
12+
else
13+
use nix
14+
fi
15+
16+
# Reload if these files change:
17+
watch_file $(find . -name '*.cabal' -o -name '*.nix')

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/TAGS

CHANGES.md

Whitespace-only changes.

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2020 Peter J. Jones <[email protected]>
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
1. Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the
14+
distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Whitespace-only changes.

Setup.hs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- |
2+
--
3+
-- Copyright:
4+
-- This file is part of the package addy. It is subject to the license
5+
-- terms in the LICENSE file found in the top-level directory of this
6+
-- distribution and at:
7+
--
8+
-- https://code.devalot.com/open/addy
9+
--
10+
-- No part of this package, including this file, may be copied,
11+
-- modified, propagated, or distributed except according to the terms
12+
-- contained in the LICENSE file.
13+
--
14+
-- License: BSD-2-Clause
15+
import Distribution.Simple
16+
main = defaultMain

addy.cabal

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
cabal-version: 2.2
2+
3+
--------------------------------------------------------------------------------
4+
name: addy
5+
version: 0.1.0.0
6+
synopsis: Modern email parsing and validating
7+
license: BSD-2-Clause
8+
license-file: LICENSE
9+
author: Peter Jones <[email protected]>
10+
maintainer: Peter Jones <[email protected]>
11+
copyright: Copyright (c) 2019-2020 Peter Jones
12+
category: Text
13+
tested-with: GHC == 8.6.5
14+
build-type: Simple
15+
description: Parse and validate email addresses, even modern ones with Unicode characters.
16+
17+
--------------------------------------------------------------------------------
18+
extra-source-files:
19+
README.md
20+
CHANGES.md
21+
test/isemail.json
22+
test/README.md
23+
24+
--------------------------------------------------------------------------------
25+
common options
26+
default-language: Haskell2010
27+
28+
default-extensions:
29+
DeriveAnyClass
30+
DeriveFoldable
31+
DeriveFunctor
32+
DeriveGeneric
33+
DeriveTraversable
34+
DerivingVia
35+
GeneralizedNewtypeDeriving
36+
LambdaCase
37+
MultiParamTypeClasses
38+
NamedFieldPuns
39+
NumericUnderscores
40+
OverloadedStrings
41+
RankNTypes
42+
RecordWildCards
43+
ScopedTypeVariables
44+
StandaloneDeriving
45+
TupleSections
46+
47+
ghc-options:
48+
-Wall
49+
-Wno-name-shadowing
50+
-Werror=incomplete-record-updates
51+
-Werror=incomplete-uni-patterns
52+
-Werror=missing-home-modules
53+
-Widentities
54+
-Wmissing-export-lists
55+
-Wredundant-constraints
56+
57+
--------------------------------------------------------------------------------
58+
common dependencies
59+
build-depends:
60+
attoparsec >= 0.13 && < 0.14,
61+
base >= 4.9 && < 5.0,
62+
ip >= 1.4 && < 1.8,
63+
relude >= 0.6 && < 0.7,
64+
text >= 1.2 && < 1.3,
65+
text-icu >= 0.7 && < 0.8
66+
67+
mixins: base hiding (Prelude)
68+
, relude (Relude as Prelude)
69+
70+
--------------------------------------------------------------------------------
71+
library
72+
import: options, dependencies
73+
hs-source-dirs: src
74+
exposed-modules:
75+
Addy.Internal.Parser
76+
Addy.Internal.Types
77+
78+
--------------------------------------------------------------------------------
79+
test-suite test
80+
import: options, dependencies
81+
type: exitcode-stdio-1.0
82+
hs-source-dirs: test
83+
main-is: Main.hs
84+
other-modules:
85+
ParserTest
86+
build-depends:
87+
aeson >= 1.4,
88+
addy,
89+
http-types >= 0.12,
90+
tasty >= 1.1 && < 1.3,
91+
tasty-hunit >= 0.10 && < 0.11

default.nix

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{ sources ? import ./nix/sources.nix
2+
, pkgs ? import sources.nixpkgs { }
3+
, nix-hs ? import sources.nix-hs { inherit pkgs; }
4+
, ghcide ? sources.ghcide-nix
5+
, ormolu ? sources.ormolu
6+
, ghc ? "default"
7+
}:
8+
9+
nix-hs {
10+
cabal = ./addy.cabal;
11+
compiler = ghc;
12+
13+
overrides = lib: self: super: with lib; {
14+
ghcide = import ghcide { ghc = compilerName; };
15+
16+
ormolu = (import ormolu {
17+
inherit (lib) pkgs;
18+
ormoluCompiler = lib.compilerName;
19+
}).ormolu;
20+
21+
ip = unBreak (dontCheck super.ip);
22+
wide-word = unBreak (dontCheck (doJailbreak super.wide-word));
23+
24+
relude =
25+
if super ? relude_0_6_0_0
26+
then super.relude_0_6_0_0
27+
else super.relude;
28+
};
29+
}

0 commit comments

Comments
 (0)