Skip to content

Commit f6eaee4

Browse files
author
Daniel YU
committed
first commit
0 parents  commit f6eaee4

15 files changed

+1249
-0
lines changed

.gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# Created by https://www.gitignore.io/api/haskell
3+
4+
### Haskell ###
5+
dist
6+
dist-*
7+
cabal-dev
8+
*.o
9+
*.hi
10+
*.chi
11+
*.chs.h
12+
*.dyn_o
13+
*.dyn_hi
14+
.hpc
15+
.hsenv
16+
.cabal-sandbox/
17+
cabal.sandbox.config
18+
*.prof
19+
*.aux
20+
*.hp
21+
*.eventlog
22+
.stack-work/
23+
cabal.project.local
24+
.HTF/
25+
26+
.DS_Store
27+
sql
28+
*-exe
29+
pgdata
30+
report.html
31+
app.yaml
32+
33+
.vscode
34+
35+
# End of https://www.gitignore.io/api/haskell

.stylish-haskell.yaml

+247
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
# stylish-haskell configuration file
2+
# ==================================
3+
4+
# The stylish-haskell tool is mainly configured by specifying steps. These steps
5+
# are a list, so they have an order, and one specific step may appear more than
6+
# once (if needed). Each file is processed by these steps in the given order.
7+
steps:
8+
# Convert some ASCII sequences to their Unicode equivalents. This is disabled
9+
# by default.
10+
# - unicode_syntax:
11+
# # In order to make this work, we also need to insert the UnicodeSyntax
12+
# # language pragma. If this flag is set to true, we insert it when it's
13+
# # not already present. You may want to disable it if you configure
14+
# # language extensions using some other method than pragmas. Default:
15+
# # true.
16+
# add_language_pragma: true
17+
18+
# Align the right hand side of some elements. This is quite conservative
19+
# and only applies to statements where each element occupies a single
20+
# line.
21+
- simple_align:
22+
cases: true
23+
top_level_patterns: true
24+
records: true
25+
26+
# Import cleanup
27+
- imports:
28+
# There are different ways we can align names and lists.
29+
#
30+
# - global: Align the import names and import list throughout the entire
31+
# file.
32+
#
33+
# - file: Like global, but don't add padding when there are no qualified
34+
# imports in the file.
35+
#
36+
# - group: Only align the imports per group (a group is formed by adjacent
37+
# import lines).
38+
#
39+
# - none: Do not perform any alignment.
40+
#
41+
# Default: global.
42+
align: global
43+
44+
# The following options affect only import list alignment.
45+
#
46+
# List align has following options:
47+
#
48+
# - after_alias: Import list is aligned with end of import including
49+
# 'as' and 'hiding' keywords.
50+
#
51+
# > import qualified Data.List as List (concat, foldl, foldr, head,
52+
# > init, last, length)
53+
#
54+
# - with_alias: Import list is aligned with start of alias or hiding.
55+
#
56+
# > import qualified Data.List as List (concat, foldl, foldr, head,
57+
# > init, last, length)
58+
#
59+
# - new_line: Import list starts always on new line.
60+
#
61+
# > import qualified Data.List as List
62+
# > (concat, foldl, foldr, head, init, last, length)
63+
#
64+
# Default: after_alias
65+
list_align: after_alias
66+
67+
# Long list align style takes effect when import is too long. This is
68+
# determined by 'columns' setting.
69+
#
70+
# - inline: This option will put as much specs on same line as possible.
71+
#
72+
# - new_line: Import list will start on new line.
73+
#
74+
# - new_line_multiline: Import list will start on new line when it's
75+
# short enough to fit to single line. Otherwise it'll be multiline.
76+
#
77+
# - multiline: One line per import list entry.
78+
# Type with constructor list acts like single import.
79+
#
80+
# > import qualified Data.Map as M
81+
# > ( empty
82+
# > , singleton
83+
# > , ...
84+
# > , delete
85+
# > )
86+
#
87+
# Default: inline
88+
long_list_align: multiline
89+
90+
# Align empty list (importing instances)
91+
#
92+
# Empty list align has following options
93+
#
94+
# - inherit: inherit list_align setting
95+
#
96+
# - right_after: () is right after the module name:
97+
#
98+
# > import Vector.Instances ()
99+
#
100+
# Default: inherit
101+
empty_list_align: inherit
102+
103+
# List padding determines indentation of import list on lines after import.
104+
# This option affects 'long_list_align'.
105+
#
106+
# - <integer>: constant value
107+
#
108+
# - module_name: align under start of module name.
109+
# Useful for 'file' and 'group' align settings.
110+
list_padding: 4
111+
112+
# Separate lists option affects formatting of import list for type
113+
# or class. The only difference is single space between type and list
114+
# of constructors, selectors and class functions.
115+
#
116+
# - true: There is single space between Foldable type and list of it's
117+
# functions.
118+
#
119+
# > import Data.Foldable (Foldable (fold, foldl, foldMap))
120+
#
121+
# - false: There is no space between Foldable type and list of it's
122+
# functions.
123+
#
124+
# > import Data.Foldable (Foldable(fold, foldl, foldMap))
125+
#
126+
# Default: true
127+
separate_lists: true
128+
129+
# Space surround option affects formatting of import lists on a single
130+
# line. The only difference is single space after the initial
131+
# parenthesis and a single space before the terminal parenthesis.
132+
#
133+
# - true: There is single space associated with the enclosing
134+
# parenthesis.
135+
#
136+
# > import Data.Foo ( foo )
137+
#
138+
# - false: There is no space associated with the enclosing parenthesis
139+
#
140+
# > import Data.Foo (foo)
141+
#
142+
# Default: false
143+
space_surround: false
144+
145+
# Language pragmas
146+
- language_pragmas:
147+
# We can generate different styles of language pragma lists.
148+
#
149+
# - vertical: Vertical-spaced language pragmas, one per line.
150+
#
151+
# - compact: A more compact style.
152+
#
153+
# - compact_line: Similar to compact, but wrap each line with
154+
# `{-#LANGUAGE #-}'.
155+
#
156+
# Default: vertical.
157+
style: vertical
158+
159+
# Align affects alignment of closing pragma brackets.
160+
#
161+
# - true: Brackets are aligned in same column.
162+
#
163+
# - false: Brackets are not aligned together. There is only one space
164+
# between actual import and closing bracket.
165+
#
166+
# Default: true
167+
align: true
168+
169+
# stylish-haskell can detect redundancy of some language pragmas. If this
170+
# is set to true, it will remove those redundant pragmas. Default: true.
171+
remove_redundant: true
172+
173+
# Replace tabs by spaces. This is disabled by default.
174+
# - tabs:
175+
# # Number of spaces to use for each tab. Default: 8, as specified by the
176+
# # Haskell report.
177+
# spaces: 8
178+
179+
# Remove trailing whitespace
180+
- trailing_whitespace: {}
181+
182+
# A common setting is the number of columns (parts of) code will be wrapped
183+
# to. Different steps take this into account. Default: 80.
184+
columns: 80
185+
186+
# By default, line endings are converted according to the OS. You can override
187+
# preferred format here.
188+
#
189+
# - native: Native newline format. CRLF on Windows, LF on other OSes.
190+
#
191+
# - lf: Convert to LF ("\n").
192+
#
193+
# - crlf: Convert to CRLF ("\r\n").
194+
#
195+
# Default: native.
196+
newline: native
197+
198+
# Sometimes, language extensions are specified in a cabal file or from the
199+
# command line instead of using language pragmas in the file. stylish-haskell
200+
# needs to be aware of these, so it can parse the file correctly.
201+
#
202+
# No language extensions are enabled by default.
203+
language_extensions:
204+
- AutoDeriveTypeable
205+
- BangPatterns
206+
- BinaryLiterals
207+
- ConstraintKinds
208+
- DataKinds
209+
- DefaultSignatures
210+
- DeriveDataTypeable
211+
- DeriveFoldable
212+
- DeriveFunctor
213+
- DeriveGeneric
214+
- DeriveTraversable
215+
- DuplicateRecordFields
216+
- DoAndIfThenElse
217+
- EmptyDataDecls
218+
- ExistentialQuantification
219+
- FlexibleContexts
220+
- FlexibleInstances
221+
- FunctionalDependencies
222+
- GADTs
223+
- GeneralizedNewtypeDeriving
224+
- InstanceSigs
225+
- KindSignatures
226+
- LambdaCase
227+
- MonadFailDesugaring
228+
- MultiParamTypeClasses
229+
- MultiWayIf
230+
- NamedFieldPuns
231+
- OverloadedStrings
232+
- PartialTypeSignatures
233+
- PatternGuards
234+
- PolyKinds
235+
- RankNTypes
236+
- RecordWildCards
237+
- ScopedTypeVariables
238+
- StandaloneDeriving
239+
- TupleSections
240+
- TypeApplications
241+
- TypeFamilies
242+
- TypeOperators
243+
- TypeSynonymInstances
244+
- ViewPatterns
245+
- TypeInType
246+
# - TemplateHaskell
247+
# - QuasiQuotes

.travis.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This is the simple Travis configuration, which is intended for use
2+
# on applications which do not require cross-platform and
3+
# multiple-GHC-version support. For more information and other
4+
# options, see:
5+
#
6+
# https://docs.haskellstack.org/en/stable/travis_ci/
7+
#
8+
# Copy these contents into the root directory of your Github project in a file
9+
# named .travis.yml
10+
11+
# Use new container infrastructure to enable caching
12+
sudo: enabled
13+
14+
# Do not choose a language; we provide our own build tools.
15+
language: haskell
16+
17+
ghc:
18+
- "8.4"

LICENSE

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright Daniel YU (c) 2018
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of Daniel YU nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# tensors

Setup.hs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain

package.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: tensors
2+
version: 0.1.0
3+
synopsis: Tensor in Haskell
4+
description: Tensor use type level programming in haskell.
5+
homepage: https://github.com/leptonyu/tensors#readme
6+
license: BSD3
7+
author: Daniel YU
8+
maintainer: Daniel YU <[email protected]>
9+
copyright: (c) 2018 Daniel YU
10+
category: Library
11+
extra-source-files:
12+
- README.md
13+
14+
ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-orphans -fno-warn-missing-signatures
15+
16+
17+
dependencies:
18+
- base >= 4.7 && < 5
19+
- vector
20+
- singletons
21+
22+
library:
23+
source-dirs: src
24+
exposed-modules:
25+
- Data.Tensor
26+
other-modules:
27+
- Data.Tensor.Type
28+
- Data.Tensor.Index
29+
- Data.Tensor.Tensor
30+
- Data.Tensor.Matrix
31+
tests:
32+
spec:
33+
main: Spec.hs
34+
source-dirs:
35+
- test
36+
- src
37+
dependencies:
38+
- hspec == 2.*
39+
- QuickCheck

0 commit comments

Comments
 (0)