From 021477770ca325d6c994070650159c508b7184f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20=C5=9Aled=C5=BA?= Date: Sat, 31 Aug 2019 02:14:44 +0200 Subject: [PATCH 01/10] [release] prepare for next development iteration --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index bb576db..f35288e 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.3 +2.4-SNAPSHOT From b40adbb643b829c30b69c4c3decc80daff72dd41 Mon Sep 17 00:00:00 2001 From: tpoindex Date: Wed, 11 Sep 2019 20:17:45 -0600 Subject: [PATCH 02/10] fix comma quoting in tup/tupx by quoting all commas --- src/fun.sh | 4 ++-- test/tup_test.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fun.sh b/src/fun.sh index ba7b33b..c8c4420 100755 --- a/src/fun.sh +++ b/src/fun.sh @@ -262,7 +262,7 @@ tup() { read arg tup $arg else - list "$@" | map lambda x . 'echo ${x/,/u002c}' | join , '(' ')' + list "$@" | map lambda x . 'echo ${x//,/u002c}' | join , '(' ')' fi } @@ -274,7 +274,7 @@ tupx() { else local n=$1 shift - echo "$@" | stripl '(' | stripr ')' | cut -d',' -f${n} | tr ',' '\n' | map lambda x . 'echo ${x/u002c/,}' + echo "$@" | stripl '(' | stripr ')' | cut -d',' -f${n} | tr ',' '\n' | map lambda x . 'echo ${x//u002c/,}' fi } diff --git a/test/tup_test.sh b/test/tup_test.sh index bdd5ac1..78cdeb8 100755 --- a/test/tup_test.sh +++ b/test/tup_test.sh @@ -9,6 +9,7 @@ testTupIfOneElement() { assertEquals '(")' $(tup '"') assertEquals "(')" $(tup "'") assertEquals "(u002c)" $(tup ",") + assertEquals "(u002cu002c)" $(tup ",,") assertEquals "(()" $(tup "(") assertEquals "())" $(tup ")") } @@ -38,6 +39,7 @@ testTupxIfZeroIndex() { testTupxIfSpecialChars() { assertEquals ',' "$(tup ',' | tupx 1)" + assertEquals ',,' "$(tup ',,' | tupx 1)" assertEquals '(' "$(tup '(' | tupx 1)" assertEquals ')' "$(tup ')' | tupx 1)" assertEquals '()' "$(tup '()' | tupx 1)" @@ -45,6 +47,7 @@ testTupxIfSpecialChars() { assertEquals '(' "$(tup '(' '(' | tupx 1)" assertEquals ')' "$(tup ')' ')' | tupx 1)" assertEquals ',' "$(tup 'u002c' | tupx 1)" + assertEquals ',,' "$(tup 'u002cu002c' | tupx 1)" } testTupxRange() { @@ -66,4 +69,4 @@ testTupr() { assertEquals '5' "$(tup 5 | tupr)" } -. ./shunit2-init.sh \ No newline at end of file +. ./shunit2-init.sh From 7736a293a02b28c208f108176a043a5a66883927 Mon Sep 17 00:00:00 2001 From: tpoindex Date: Wed, 11 Sep 2019 20:58:30 -0600 Subject: [PATCH 03/10] ntup{x,l,r} - tuples that can be nested and without quoting issues, base64 encoded elements --- src/fun.sh | 30 ++++++++++++++++++++++++++++++ test/tup_test.sh | 12 ++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/fun.sh b/src/fun.sh index c8c4420..48b0894 100755 --- a/src/fun.sh +++ b/src/fun.sh @@ -286,6 +286,36 @@ tupr() { tupx 1- "$@" | last } +ntup() { + if [[ $# -eq 0 ]]; then + local arg + read arg + ntup $arg + else + list "$@" | map lambda x . 'echo "$x" | base64 --wrap=0 ; echo' | join , '(' ')' + fi +} + +ntupx() { + if [[ $# -eq 1 ]]; then + local arg + read arg + ntupx "$1" "$arg" + else + local n=$1 + shift + echo "$@" | stripl '(' | stripr ')' | cut -d',' -f${n} | tr , '\n' | map lambda x . 'echo "$x" | base64 -d' + fi +} + +ntupl() { + ntupx 1 "$@" +} + +ntupr() { + ntupx 1- "$@" | last +} + zip() { local list=$* cat - | while read x; do diff --git a/test/tup_test.sh b/test/tup_test.sh index 78cdeb8..25cd8bf 100755 --- a/test/tup_test.sh +++ b/test/tup_test.sh @@ -69,4 +69,16 @@ testTupr() { assertEquals '5' "$(tup 5 | tupr)" } +testNTup() { + assertEquals '(KFlRbz0sWWdvPSkK,Ywo=)' "$(ntup $(ntup a b) c)" + assertEquals '(YQo=,Ygo=)' "$(ntupl '(KFlRbz0sWWdvPSkK,Ywo=)')" + assertEquals 'a' "$(ntupl '(YQo=,Ygo=)')" + assertEquals 'b' "$(ntupr '(YQo=,Ygo=)')" + assertEquals 'c' "$(ntupr '(KFlRbz0sWWdvPSkK,Ywo=)')" + assertEquals 'a' "$(ntup $(ntup a b) c | ntupx 1 | ntupx 1)" + assertEquals 'b' "$(ntup $(ntup a b) c | ntupx 1 | ntupx 2)" + assertEquals 'c' "$(ntup $(ntup a b) c | ntupx 2)" + assertEquals 'a b' "$(ntup $(ntup a b) c | ntupx 1 | ntupx 1,2 | unlist)" +} + . ./shunit2-init.sh From b19ab5180b28ca6e5dcab0dce68404c19f354dca Mon Sep 17 00:00:00 2001 From: tpoindex Date: Wed, 11 Sep 2019 22:47:39 -0600 Subject: [PATCH 04/10] maybe monad and friends maybe - return a tuple of (Nothing) or (Just,value) maybemap - apply map function when maybe has a value and wrap in another maybe; else when nothing return nothing maybevalue - return value of maybe; else when nothing return optional default args --- src/fun.sh | 40 ++++++++++++++++++++++++++++++++++++++++ test/maybe_test.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100755 test/maybe_test.sh diff --git a/src/fun.sh b/src/fun.sh index 48b0894..e1ad6d9 100755 --- a/src/fun.sh +++ b/src/fun.sh @@ -358,3 +358,43 @@ call() { local args=$@ tup $f $args } + +maybe() { + if [[ $# -eq 0 ]]; then + local arg + read arg + maybe "$arg" + else + local x="$*" + local value=$(echo $x | strip) + if [[ ${#value} -eq 0 ]]; then + tup Nothing + else + tup Just "$value" + fi + fi +} + +maybemap() { + local x + read x + if [[ $(tupl $x) = "Nothing" ]]; then + echo $x + else + local y=$(tupr "$x") + local r=$(echo "$y" | map "$@") + maybe "$r" + fi +} + +maybevalue() { + local default="$*" + local x + read x + if [[ $(tupl $x) = "Nothing" ]]; then + echo "$default" + else + echo $(tupr $x) + fi +} + diff --git a/test/maybe_test.sh b/test/maybe_test.sh new file mode 100755 index 0000000..1003179 --- /dev/null +++ b/test/maybe_test.sh @@ -0,0 +1,29 @@ +#! /bin/bash + +testMaybe() { + assertEquals '(Just,1)' "$(maybe 1)" + assertEquals '(Just,1)' "$(echo 1 | maybe)" + assertEquals '(Nothing)' "$(maybe '')" + assertEquals '(Nothing)' "$(maybe ' ')" + assertEquals '(Nothing)' "$(maybe ' ' ' ' ' ')" + assertEquals '(Nothing)' "$(echo | maybe)" + assertEquals '(Just,1 2 3)' "$(maybe 1 2 3)" + assertEquals '(Just,1 2 3)' "$(echo 1 2 3 | maybe)" +} + +testMaybemap() { + assertEquals '(Just,3)' "$(echo 1 | maybe | maybemap lambda a . 'echo $(( a + 1 ))' | maybemap lambda a . 'echo $(( a + 1 ))')" + assertEquals '(Nothing)' "$(echo | maybe | maybemap lambda a . 'echo $(( a + 1 ))' | maybemap lambda a . 'echo $(( a + 1 ))')" + + assertEquals '(Nothing)' "$(echo 1 | maybe | maybemap lambda a . 'echo $(( a + 1 ))' | maybemap lambda a . 'echo')" + assertEquals '(Nothing)' "$(echo 1 | maybe | maybemap lambda a . 'echo $(( a + 1 ))' | maybemap lambda a . 'echo' | maybemap lambda a . 'echo $(( a + 1 ))')" +} + +testMaybevalue() { + assertEquals 3 "$(echo 1 | maybe | maybemap lambda a . 'echo $(( a + 1 ))' | maybemap lambda a . 'echo $(( a + 1 ))' | maybevalue 0)" + assertEquals 0 "$(echo | maybe | maybemap lambda a . 'echo $(( a + 1 ))' | maybemap lambda a . 'echo $(( a + 1 ))' | maybevalue 0)" + assertEquals 'a b c' "$(echo | maybe | maybemap lambda a . 'echo $(( a + 1 ))' | maybemap lambda a . 'echo $(( a + 1 ))' | maybevalue a b c)" +} + + +. ./shunit2-init.sh From 44dbdd3fbc71b015dc1c40cad46cde3572b3d62f Mon Sep 17 00:00:00 2001 From: tpoindex Date: Wed, 11 Sep 2019 23:46:47 -0600 Subject: [PATCH 05/10] fluent predicates for filtering --- src/fun.sh | 37 +++++++++++++++++++++++++++++ test/predicates_test.sh | 52 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100755 test/predicates_test.sh diff --git a/src/fun.sh b/src/fun.sh index e1ad6d9..5d44542 100755 --- a/src/fun.sh +++ b/src/fun.sh @@ -398,3 +398,40 @@ maybevalue() { fi } + +# commonly used predicates for filter +# e.g. list 1 a 2 b 3 c | filter lambda x . 'isint $x' + +# inverse another test, e.g. "not isint $x" +not() { + local r=$("$@" 2>/dev/null) + $r && ret false || ret true +} + +isint() { + [ "$1" -eq "$1" ] 2>/dev/null && ret true || ret false +} + +isempty() { + [ -z "$1" ] && ret true || ret false +} + +isfile() { + [ -f "$1" ] && ret true || ret false +} + +isnonzerofile() { + [ -s "$1" ] && ret true || ret false +} + +isreadable() { + [ -r "$1" ] && ret true || ret false +} + +iswritable() { + [ -w "$1" ] && ret true || ret false +} + +isdir() { + [ -d "$1" ] && ret true || ret false +} diff --git a/test/predicates_test.sh b/test/predicates_test.sh new file mode 100755 index 0000000..79bff20 --- /dev/null +++ b/test/predicates_test.sh @@ -0,0 +1,52 @@ +#! /bin/bash + +testIsint() { + assertEquals 'true' $(isint 1) + assertEquals 'true' $(isint -1) + assertEquals 'false' $(isint a) + assertEquals 'false' $(isint "") + assertEquals '1 2 3 4 5' "$(list 1 a 2 b 3 c 4 d 5 e | filter lambda x . 'isint $x' | unlist )" + assertEquals '1 2' "$(list 1 a 2 b 3 c 4 d 5 e | filter lambda x . '($(isint $x) && [[ $x -le 2 ]] && ret true) || ret false ' | unlist )" + + assertEquals 'false' $(not isint 1) + assertEquals 'true' $(not isint a) +} + +testIsempty() { + assertEquals 'true' $(isempty "") + assertEquals 'false' $(isempty a) + + assertEquals 'true' $(not isempty a) + assertEquals 'false' $(not isempty "") +} + +testIsfile() { + f=$(mktemp) + + assertEquals 'true' $(isfile $f) + assertEquals 'false' $(isfile $f.xxx) + assertEquals 'false' $(isfile "") + assertEquals 'true' $(not isfile $f.xxx) + + assertEquals 'false' $(isnonzerofile $f) + echo hello world >$f + assertEquals 'true' $(isnonzerofile $f) + + assertEquals 'true' $(iswritable $f) + chmod 400 $f + assertEquals 'false' $(iswritable $f) + + assertEquals 'true' $(isreadable $f) + chmod 200 $f + assertEquals 'false' $(isreadable $f) + + chmod 600 $f + rm $f +} + +testIsdir() { + assertEquals 'true' $(isdir .) + assertEquals 'false' $(isdir sir_not_appearing_in_this_film) +} + +. ./shunit2-init.sh From 1b234ff597d4eceb5774c81a8b3befc567c20692 Mon Sep 17 00:00:00 2001 From: tpoindex Date: Wed, 11 Sep 2019 23:53:56 -0600 Subject: [PATCH 06/10] avoid collisions with common /usr/bin/ commands rename head, tail, zip to lhead, ltail, and lzip to avoid collisions with command unix commands --- src/fun.sh | 6 +++--- test/head_test.sh | 16 ++++++++-------- test/tail_test.sh | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/fun.sh b/src/fun.sh index 5d44542..08f3bc1 100755 --- a/src/fun.sh +++ b/src/fun.sh @@ -8,11 +8,11 @@ take() { command head -n ${1} } -tail() { +ltail() { drop 1 } -head() { +lhead() { take 1 } @@ -316,7 +316,7 @@ ntupr() { ntupx 1- "$@" | last } -zip() { +lzip() { local list=$* cat - | while read x; do y=$(list $list | take 1) diff --git a/test/head_test.sh b/test/head_test.sh index 3ea2a7f..90ea201 100755 --- a/test/head_test.sh +++ b/test/head_test.sh @@ -1,16 +1,16 @@ #! /bin/bash -testHeadFromList() { - assertEquals 1 $(list {1..10} | head) - assertEquals 5 $(list 5 6 7 | head) +testLHeadFromList() { + assertEquals 1 $(list {1..10} | lhead) + assertEquals 5 $(list 5 6 7 | lhead) } -testHeadFromOneElementList() { - assertEquals 1 $(list 1 | head) +testLHeadFromOneElementList() { + assertEquals 1 $(list 1 | lhead) } -testHeadFromEmptyList() { - assertEquals "" "$(list | head)" +testLHeadFromEmptyList() { + assertEquals "" "$(list | lhead)" } -. ./shunit2-init.sh \ No newline at end of file +. ./shunit2-init.sh diff --git a/test/tail_test.sh b/test/tail_test.sh index 57971ad..b2b19f5 100755 --- a/test/tail_test.sh +++ b/test/tail_test.sh @@ -1,15 +1,15 @@ #! /bin/bash -testTailFrom10() { - assertEquals "2 3 4 5 6 7 8 9 10" "$(list {1..10} | tail | unlist)" +testLTailFrom10() { + assertEquals "2 3 4 5 6 7 8 9 10" "$(list {1..10} | ltail | unlist)" } -testTailFromOneElementList() { - assertEquals "" "$(list 1 | tail)" +testLTailFromOneElementList() { + assertEquals "" "$(list 1 | ltail)" } -testTailFromEmptyList() { - assertEquals "" "$(list | tail)" +testLTailFromEmptyList() { + assertEquals "" "$(list | ltail)" } -. ./shunit2-init.sh \ No newline at end of file +. ./shunit2-init.sh From 540840e9d28b567ddb9ccfa145ccebb06c3cd43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20=C5=9Aled=C5=BA?= Date: Sat, 14 Sep 2019 20:23:38 +0200 Subject: [PATCH 07/10] Manually bumping version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index f35288e..9dcc69b 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.4-SNAPSHOT +2.5-SNAPSHOT From b590285ec985bdaf97b0b4c1e32ac87870cd0c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20=C5=9Aled=C5=BA?= Date: Tue, 1 Oct 2019 00:02:34 +0200 Subject: [PATCH 08/10] Fixing examples & documentation + adding example of usage to documentation. --- README.md | 97 +++++++++++++++++++++++++++++++++++++++------ examples/example.sh | 18 ++++----- 2 files changed, 93 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 3efb131..e44672b 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,17 @@ seq 1 4 | sum # Functions overview ||||||| |------|------|------|------|------|------| -|**plus**|**append**|**buff**|**curry**|**div**|**drop**| -|**factorial**|**filter**|**foldl**|**foldr**|**head**|**join**| -|**lambda**|**last**|**list**|**map**|**mod**|**mul**| -|**prepend**|**product**|**ret**|**revers_str**|**revers**|**scanl**| -|**splitc**|**strip**|**sub**|**sum**|**tail**|**take**| -|**catch**|**try**|**tupl**|**tupr**|**tup**|**tupx**| -|**unlist**|**zip**|**λ**|**with_trampoline**|**res**|**call**| +|**append**|**buff**|**call**|**catch**|**curry**|**div**| +|**drop**|**dropw**|**factorial**|**filter**|**foldl**|**foldr**| +|**isint**|**isempty**|**isfile**|**isnonzerofile**|**isreadable**|**iswritable**| +|**isdir**|**join**|**lambda**|**last**|**lhead**|**list**| +|**ltail**|**lzip**|**map**|**maybe**|**maybemap**|**maybevalue**| +|**mod**|**mul**|**not**|**ntup**|**ntupl**|**ntupr**| +|**ntupx**|**peek**|**plus**|**prepend**|**product**|**ret**| +|**res**|**revers**|**revers_str**|**scanl**|**splitc**|**strip**| +|**stripl**|**stripr**|**sub**|**sum**|**take**|**try**| +|**tup**|**tupl**|**tupr**|**tupx**|**unlist**|**λ**| +|**with_trampoline**| ## *list/unlist* @@ -34,17 +38,17 @@ $ list 1 2 3 4 5 | unlist 1 2 3 4 5 ``` -## *take/drop/tail/head/last* +## *take/drop/ltail/lhead/last* ```bash $ list 1 2 3 4 | drop 2 3 4 -$ list 1 2 3 4 5 | head +$ list 1 2 3 4 5 | lhead 1 -$ list 1 2 3 4 | tail +$ list 1 2 3 4 | ltail 2 3 4 @@ -190,6 +194,30 @@ one 2 ``` +## *ntup/ntupx/ntupl/ntupr* + +```bash +$ ntup a 1 b 2 c 3 +(YQo=,MQo=,Ygo=,Mgo=,Ywo=,Mwo=) + +$ echo '(YQo=,MQo=,Ygo=,Mgo=,Ywo=,Mwo=)' | ntupx 3 +b + +$ ntup 'foo bar' 1 one 1 +(Zm9vIGJhcgo=,MQo=,b25lCg==,MQo=) + +$ echo '(Zm9vIGJhcgo=,MQo=,b25lCg==,MQo=)' | ntupx 1 +foo bar +``` + +```bash +$ ntupl $(ntup 'foo bar' 1 one 2) +foo bar + +$ ntupr $(ntup 'foo bar' 1 one 2) +2 +``` + ## *buff* ```bash @@ -205,10 +233,10 @@ $ seq 1 10 | buff λ a b c d e . 'echo $(($a + $b + $c + $d + $e))' 40 ``` -## *zip* +## *lzip* ```bash -$ list a b c d e f | zip $(seq 1 10) +$ list a b c d e f | lzip $(seq 1 10) (a,1) (b,2) (c,3) @@ -218,7 +246,7 @@ $ list a b c d e f | zip $(seq 1 10) ``` ```bash -$ list a b c d e f | zip $(seq 1 10) | last | tupr +$ list a b c d e f | lzip $(seq 1 10) | last | tupr 6 ``` @@ -244,6 +272,49 @@ $ seq 1 3 | map λ a . 'inc $a' 4 ``` +## *peek* + +```bash +$ list 1 2 3 \ + | peek lambda a . echo 'dbg a : $a' \ + | map lambda a . 'mul $a 2' \ + | peek lambda a . echo 'dbg b : $a' \ + | sum + +dbg a : 1 +dbg a : 2 +dbg a : 3 +dbg b : 2 +dbg b : 4 +dbg b : 6 +12 +``` + +```bash +$ a=$(seq 1 4 | peek lambda a . echo 'dbg: $a' | sum) + +dbg: 1 +dbg: 2 +dbg: 3 +dbg: 4 + +$ echo $a + +10 +``` + +## *maybe/maybemap/maybevalue* + +TODO + +## *not/isint/isempty* + +TODO + +## *isfile/isnonzerofile/isreadable/iswritable/isdir* + +TODO + ## *try/catch* ```bash diff --git a/examples/example.sh b/examples/example.sh index 80cb792..9bcc29f 100755 --- a/examples/example.sh +++ b/examples/example.sh @@ -1,26 +1,25 @@ #!/bin/bash - source ../src/fun.sh seq 1 4 | sum seq 1 4 | product factorial 4 -seq 1 4 | scanl lambda a b . 'echo $(add $a $b)' +seq 1 4 | scanl lambda a b . 'echo $(plus $a $b)' echo map mul seq 1 4 | map lambda a . 'echo $(mul $a 2)' echo map sub seq 1 4 | map lambda a . 'echo $(sub $a 2)' -echo map add -seq 1 4 | map lambda a . 'echo $(add $a 2)' +echo map plsu +seq 1 4 | map lambda a . 'echo $(plus $a 2)' echo map div seq 1 4 | map lambda a . 'echo $(div $a 2)' echo map mod seq 1 4 | map lambda a . 'echo $(mod $a 2)' echo 'list & head' -list 1 2 3 4 5 | head +list 1 2 3 4 5 | lhead list {1..2} | append {3..4} | prepend {99..102} list {1..2} | unlist -list {1..10} | head +list {1..10} | lhead list {1..10} | drop 7 list {1..10} | take 3 list {1..10} | last @@ -83,10 +82,10 @@ seq 1 10 | buff lambda a b . 'echo $(($a + $b))' echo 'XX' seq 1 10 | buff lambda a b c d e . 'echo $(($a + $b + $c + $d + $e))' -list a b c d e f | zip $(seq 1 10) +list a b c d e f | lzip $(seq 1 10) echo -list a b c d e f | zip $(seq 1 10) | last | tupr +list a b c d e f | lzip $(seq 1 10) | last | tupr arg='[key1=value1,key2=value2,key3=value3]' get() { @@ -155,5 +154,6 @@ echo Factorial test time factorial 30 time factorial_trampoline 30 -time factorial 60 +# would be error +#time factorial 60 time factorial_trampoline 60 \ No newline at end of file From 67c88a5b3ff35a92050ead04ec5f0555ca2bf11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20=C5=9Aled=C5=BA?= Date: Tue, 1 Oct 2019 00:24:56 +0200 Subject: [PATCH 09/10] more docs --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index e44672b..f99ee1b 100644 --- a/README.md +++ b/README.md @@ -431,6 +431,21 @@ processNames adam monika s slawek d daniel Bartek j k Adam,Monika,Slawek,Daniel,Bartek ``` +# Running tests + +```bash +cd test +./test_runner +``` + +# Contribution guidelines + +Feel free to ask questions in chat, open issues, or contribute by creating pull requests. + +In order to create a pull request +* checkout develop branch +* introduce your changes +* submit pull request # Resources * [Inspiration](https://quasimal.com/posts/2012-05-21-funsh.html) From 9840e94a5d9ccb6396e8e182e8c765b86765a52e Mon Sep 17 00:00:00 2001 From: Slawomir Sledz Date: Tue, 1 Oct 2019 00:34:01 +0200 Subject: [PATCH 10/10] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4779b34 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Sławomir Śledź + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.