-
Notifications
You must be signed in to change notification settings - Fork 0
/
jaskell.cabal
88 lines (77 loc) · 2.74 KB
/
jaskell.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
cabal-version: 2.4
name: jaskell
version: 0.1.0.0
author: Owen Bechtel
maintainer: [email protected]
category: Language
synopsis: Stack-based concatenative language embedded in Haskell
description:
Jaskell is a stack-based programming language implemented using normal Haskell
types and functions, along with a quasiquoter that allows for a more elegant syntax
than what pure Haskell supports. Since it is embedded in Haskell, Jaskell is purely
functional and, unlike other stack-based languages, statically typed. The standard
library is based on that of [Joy](https://www.kevinalbrecht.com/code/joy-mirror/),
and the name \"Jaskell\" is a portmanteau of \"Joy\" and \"Haskell.\"
.
A Jaskell program is a sequence of commands. Each command is a function which takes
a stack — represented in Haskell as a left-nested tuple — and returns another stack.
In order to accomodate side effects, commands need not actually be functions; any
arrow is allowed as a command. The two most useful arrow types are @(->)@ and @Kleisli IO@.
.
Two example programs are shown below. The first program asks for the user's name and then
prints a greeting. The second program defines a @qsort@ function and then uses it to
sort a list.
.
> {-# LANGUAGE QuasiQuotes #-}
> import qualified Jaskell
> import Jaskell.Quote (jsl)
> import Jaskell.Prelude
>
> main :: IO ()
> main = Jaskell.runK [jsl|
> "What's your name?" !putStrLn [ "Hello, ", ?getLine, "!" ] $concat !putStrLn
> |]
>
> sorted :: ((), [Int])
> sorted = Jaskell.run [jsl|
> DEF small =
> { $null } { uncons $null } disjoin ;
> DEF qsort =
> small { } { uncons { < } split rolldown }
> { swap cons ++ } binrec' ;
> [3,5,1,6,4,2] qsort
> |]
homepage: https://github.com/UnaryPlus/jaskell
bug-reports: https://github.com/UnaryPlus/jaskell/issues
license: MIT
license-file: LICENSE
extra-source-files: CHANGELOG.md, README.md
source-repository head
type: git
location: https://github.com/UnaryPlus/jaskell.git
library
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
exposed-modules:
Jaskell,
Jaskell.Prelude,
Jaskell.Quote
build-depends:
base >= 4.13.0.0 && < 5,
megaparsec >= 9.0.0 && < 10,
template-haskell >= 2.16.0.0 && < 2.21
test-suite test
type: exitcode-stdio-1.0
hs-source-dirs: test
default-language: Haskell2010
ghc-options: -Wall
main-is: Spec.hs
other-modules:
JaskellSpec,
Jaskell.PreludeSpec,
Jaskell.QuoteSpec
build-depends:
base, hspec, megaparsec, directory, jaskell
build-tool-depends:
hspec-discover:hspec-discover