-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
frege.scroll
154 lines (128 loc) · 4.35 KB
/
frege.scroll
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import ../code/conceptPage.scroll
id frege
name Frege
appeared 2011
tags pl
website https://github.com/Frege/frege
latestVersion 3.23.288
isOpenSource true
writtenIn forth java tex perl svg markdown make yacc bourne-shell html yaml
fileType text
documentation http://www.frege-lang.org/doc/fregedoc.html
rosettaCode http://www.rosettacode.org/wiki/Category:Frege
centralPackageRepositoryCount 0
repoStats
firstCommit 2011
commits 3352
committers 50
files 409
newestCommit 2022
country Switzerland and Germany and United States
originCommunity https://github.com/Frege
projectEuler Frege
memberCount
2019 2
2022 3
twitter https://twitter.com/fregelang
githubRepo https://github.com/frege/frege
firstCommit 2011
stars 3546
forks 146
subscribers 154
created 2012
updated 2022
description Frege is a Haskell for the JVM. It brings purely functional programing to the Java platform.
issues 45
lineCommentToken --
multiLineCommentTokens {- -}
hasTypeInference true
hasLineComments true
-- A comment
hasComments true
-- A comment
hasMultiLineComments true
{- A comment
-}
hasSemanticIndentation false
wikipedia https://en.wikipedia.org/wiki/Frege_(programming_language)
example
{--
This program displays the
current time on standard output
every other second.
-}
module examples.CommandLineClock where
data Date = native java.util.Date where
native new :: () -> IO (MutableIO Date) -- new Date()
native toString :: Mutable s Date -> ST s String -- d.toString()
--- 'IO' action to give us the current time as 'String'
current :: IO String
current = do
d <- Date.new () -- reads system timer, hence IO
d.toString
main args =
forever do
current >>= print -- print formatted date
print "\r" -- followed by carriage return
stdout.flush -- make sure it's shown
Thread.sleep 999L -- wait 0.999 seconds
related haskell jvm java java-bytecode linux unix eclipse-editor
summary Frege is a non-strict, purely functional programming language for the Java virtual machine in the spirit of Haskell. It is considered a Haskell dialect or simply "a" Haskell for the Java virtual machine. Frege has a strong static type system with type inference. Higher rank types are supported, though type annotations are required for that. Frege programs are compiled to Java bytecode and run in a Java virtual machine. Existing Java classes and methods can be used seamlessly from Frege after their types have been properly declared. The language was designed by Ingo Wechsung, who named it after the German mathematician, logician and philosopher Gottlob Frege. (This language is unrelated to the Frege Program Prover.)
pageId 35111228
dailyPageViews 31
backlinksCount 11
appeared 2011
fileExtensions fr
githubBigQuery Frege
repos 160
users 142
linguistGrammarRepo https://github.com/atom-haskell/language-haskell
firstCommit 2014
lastCommit 2018
committerCount 13
commitCount 463
sampleCount 4
example
{--
This program displays the
current time on stdandard output
every other second.
-}
module examples.CommandLineClock where
data Date = native java.util.Date where
native new :: () -> IO (MutableIO Date) -- new Date()
native toString :: Mutable s Date -> ST s String -- d.toString()
--- 'IO' action to give us the current time as 'String'
current :: IO String
current = do
d <- Date.new ()
d.toString
{-
"java.lang.Thread.sleep" takes a "long" and
returns nothing, but may throw an InterruptedException.
This is without doubt an IO action.
public static void sleep(long millis)
throws InterruptedException
Encoded in Frege:
- argument type long Long
- result void ()
- does IO IO ()
- throws ... throws ....
-}
-- .... defined in frege.java.Lang
-- native sleep java.lang.Thread.sleep :: Long -> IO () throws InterruptedException
main args =
forever do
current >>= print
print "\r"
stdout.flush
Thread.sleep 999
isbndb 0
githubLanguage Frege
fileExtensions fr
trendingProjectsCount 0
type programming
aceMode haskell
tmScope source.haskell
repos 223
semanticScholar 0