on master help sign in
Merge branch 'master' of github.com:idris-lang/Idris-dev
ecea329Edwin Brady
contribs/idrislang.sty+153−122
@@ -2,157 +2,188 @@
2%%
2%%
3%% A set of LaTeX macros and styling for working with Idris in LaTeX
3%% A set of LaTeX macros and styling for working with Idris in LaTeX
4%%
4%%
5−%% + Provides a listings binding for Idris, to print pretty Idris Files.
5+%% + Provides a listings bindings:
6−%% + Optional default styling. \IdrisListingsDefaultStyle{}
6+%% + idris :: default ascii
7+%% + literateidris :: convert ascii maths to math symbols.
8+%% + Defines a `numbers' and `default' listings style.
7−%% + Defines a `code' environment.
9+%% + Defines a `code' environment for typesetting idris.
10+%% + \begin{code}[...] ... \end{code}
8−%% + Defines the \Idris{} command for typesetting the name.
11+%% + Defines commands typesetting the name Idris.
12+%% + \Idris{}
13+%% + \idris{}
14+%%
15+%% Options:
16+%% - literate :: turn on literate idris for code environments.
17+%% - numbers :: turn on numbers for code environments.
9%%
18%%
10%% ----------------------------------------------------------- [ Begin Package ]
19%% ----------------------------------------------------------- [ Begin Package ]
11\ProvidesPackage{idrislang}
20\ProvidesPackage{idrislang}
12
21
22+\RequirePackage{ifthen}
13\RequirePackage{listings}
23\RequirePackage{listings}
14−\RequirePackage{mathtools}
15\RequirePackage{xspace}
24\RequirePackage{xspace}
25+%% ----------------------------------------------------------------- [ Options ]
26+\newboolean{literate}
27+\setboolean{literate}{false}
28+\newboolean{numbers}
29+\setboolean{numbers}{false}
30+
31+\DeclareOption{literate}{%
32+ \setboolean{literate}{true}
33+}
34+
35+\DeclareOption{numbers}{%
36+ \setboolean{numbers}{true}
37+}
38+
39+\ProcessOptions\relax
16
40
41+%% ---------------------------------------------------------------- [ Commands ]
17\newcommand{\Idris}{\textsc{Idris}\xspace}
42\newcommand{\Idris}{\textsc{Idris}\xspace}
43+\newcommand{\idris}{\textsc{Idris}\xspace}
18
44
19%% --------------------------------------------------- [ Define Idris Listings ]
45%% --------------------------------------------------- [ Define Idris Listings ]
20\lstdefinelanguage{idris}{%
46\lstdefinelanguage{idris}{%
21 sensitive,%
47 sensitive,%
22%% ----------------------------------------------------------- [ Default Style ]
48%% ----------------------------------------------------------- [ Default Style ]
23− % Default Style
24− basicstyle=\small\ttfamily,
49+ basicstyle=\ttfamily,
25 flexiblecolumns=false,
50 flexiblecolumns=false,
26− basewidth={0.5em,0.45em},
27 commentstyle=\footnotesize\sffamily,
51 commentstyle=\footnotesize\sffamily,
28%% ---------------------------------------------------------------- [ Keywords ]
52%% ---------------------------------------------------------------- [ Keywords ]
29−%% From Idris Parser
53+%% From Idris Parser and idris-mode and vimscript
30 keywords={%
54 keywords={%
31− let, in, data, codata, record, Type, do, dsl, import, impossible,
55+ abstract, attack, case, compute, do, dsl, else, exact, focus, if,
32− case, of, total, partial, mutual, infix, infixl, infixr, rewrite,
56+ import, in, infix, infixl, infixr, instance, intros, module,
33− where, with, syntax, proof, postulate, using, namespace, class,
57+ mutual, namespace, of, let, parameters, partial, pattern, prefix,
34− instance, public, private, abstract, implicit, quoteGoal, if,
58+ private, public, refine, rewrite, solve, syntax, term, then,
35− then, else
59+ total, trivial, try, using, where, with
36− },
60+},
37%% ------------------------------------------------------- [ Prelude Functions ]
61%% ------------------------------------------------------- [ Prelude Functions ]
38%% Generated using
62%% Generated using
39%% find lib/ -name "*.idr" | xargs grep -e "^[a-zA-Z0-9]* :" | awk -F : '{printf $2", "}'
63%% find lib/ -name "*.idr" | xargs grep -e "^[a-zA-Z0-9]* :" | awk -F : '{printf $2", "}'
40 morekeywords={%
64 morekeywords={%
65+ class, data, instance, record, dsl, postulate, default, assert_total,
66+ lambda, variable, index_first, index_next
41− trace, unsafePerformPrimIO, FInt, FChar, FByte, FShort, FLong,
67+ % trace, unsafePerformPrimIO, FInt, FChar, FByte, FShort, FLong,
42− FBits8, FBits16, FBits32, FBits64, FBits8x16, FBits16x8,
68+ % FBits8, FBits16, FBits32, FBits64, FBits8x16, FBits16x8,
43− FBits32x4, FBits64x2, interpFTy, ForeignTy, mkForeignPrim,
69+ % FBits32x4, FBits64x2, interpFTy, ForeignTy, mkForeignPrim,
44− mkLazyForeignPrim, liftPrimIO, fork, unsafePerformIO, listens,
70+ % mkLazyForeignPrim, liftPrimIO, fork, unsafePerformIO, listens,
45− censor, Writer, liftReaderT, asks, Reader, modify, gets, State,
71+ % censor, Writer, liftReaderT, asks, Reader, modify, gets, State,
46− RWS, nGTSm, decideNatLTE, lte, vectInjective1, vectInjective2,
72+ % RWS, nGTSm, decideNatLTE, lte, vectInjective1, vectInjective2,
47− run, myID, send, msgWaiting, recv, recvWithSender, create,
73+ % run, myID, send, msgWaiting, recv, recvWithSender, create,
48− sendToThread, checkMsgs, getMsg, viewB8x16, viewB16x8, viewB32x4,
74+ % sendToThread, checkMsgs, getMsg, viewB8x16, viewB16x8, viewB32x4,
49− viewB64x2, pow, exp, log, pi, sin, cos, tan, asin, acos, atan,
75+ % viewB64x2, pow, exp, log, pi, sin, cos, tan, asin, acos, atan,
50− atan2, sinh, cosh, tanh, sqrt, floor, ceiling, count, countFrom,
76+ % atan2, sinh, cosh, tanh, sqrt, floor, ceiling, count, countFrom,
51− curry, uncurry, uniformB8x16, uniformB16x8, uniformB32x4,
77+ % curry, uncurry, uniformB8x16, uniformB16x8, uniformB32x4,
52− uniformB64x2, putStr, putStrLn, print, getLine, putChar, getChar,
78+ % uniformB64x2, putStr, putStrLn, print, getLine, putChar, getChar,
53− fopen, openFile, closeFile, fread, fwrite, feof, ferror, nullPtr,
79+ % fopen, openFile, closeFile, fread, fwrite, feof, ferror, nullPtr,
54− nullStr, validFile, while, readFile, userSuppliedName, seq, try,
80+ % nullStr, validFile, while, readFile, userSuppliedName, seq, try,
55− mkPair, getUName, unApply, mkApp, binderTy, divCeil, nextPow2,
81+ % mkPair, getUName, unApply, mkApp, binderTy, divCeil, nextPow2,
56− nextBytes, machineTy, bitsUsed, natToBits, getPad, pad8, pad16,
82+ % nextBytes, machineTy, bitsUsed, natToBits, getPad, pad8, pad16,
57− pad32, pad64, shiftLeft, shiftRightLogical, shiftRightArithmetic,
83+ % pad32, pad64, shiftLeft, shiftRightLogical, shiftRightArithmetic,
58− and, or, xor, plus, minus, times, sdiv, udiv, srem, urem, lt, lte,
84+ % and, or, xor, plus, minus, times, sdiv, udiv, srem, urem, lt, lte,
59− eq, gte, gt, complement, zeroExtend, intToBits, bitsToInt, bitAt,
85+ % eq, gte, gt, complement, zeroExtend, intToBits, bitsToInt, bitAt,
60− getBit, setBit, unsetBit, bitsToStr, findElem, replaceElem,
86+ % getBit, setBit, unsetBit, bitsToStr, findElem, replaceElem,
61− replaceByElem, mapElem, anyNilAbsurd, anyElim, any, negAnyAll,
87+ % replaceByElem, mapElem, anyNilAbsurd, anyElim, any, negAnyAll,
62− notAllHere, notAllThere, all, length, index, weaken, take, toList,
88+ % notAllHere, notAllThere, all, length, index, weaken, take, toList,
63− fromList, replicate, foldl, foldr, map, pad, zeroBoundIsEmpty,
89+ % fromList, replicate, foldl, foldr, map, pad, zeroBoundIsEmpty,
64− empty, insert, delete, contains, fromList, toList, applyKleisli,
90+ % empty, insert, delete, contains, fromList, toList, applyKleisli,
65− applyMor, applyEndo, absZ, negZ, negNat, minusNatZ, plusZ, subZ,
91+ % applyMor, applyEndo, absZ, negZ, negNat, minusNatZ, plusZ, subZ,
66− multZ, fromInt, natPlusZPlus, natMultZMult, doubleNegElim,
92+ % multZ, fromInt, natPlusZPlus, natMultZMult, doubleNegElim,
67− posInjective, negSInjective, posNotNeg, plusZeroLeftNeutralZ,
93+ % posInjective, negSInjective, posNotNeg, plusZeroLeftNeutralZ,
68− plusZeroRightNeutralZ, plusCommutativeZ, modBin, modComp, div,
94+ % plusZeroRightNeutralZ, plusCommutativeZ, modBin, modComp, div,
69− rem, intToMod, modToStr, branch4, branch5, branch6, branch7,
95+ % rem, intToMod, modToStr, branch4, branch5, branch6, branch7,
70− merge1, merge2, merge3, treeLookup, treeInsert, delType,
96+ % merge1, merge2, merge3, treeLookup, treeInsert, delType,
71− treeDelete, treeToList, empty, lookup, insert, delete, fromList,
97+ % treeDelete, treeToList, empty, lookup, insert, delete, fromList,
72− toList, getWitness, getProof, FalseElim, replace, sym, trans,
98+ % toList, getWitness, getProof, FalseElim, replace, sym, trans,
73− lazy, par, malloc, Not, id, the, const, fst, snd, flip, cong,
99+ % lazy, par, malloc, Not, id, the, const, fst, snd, flip, cong,
74− boolElim, not, intToBool, boolOp, div, mod, strHead, strTail,
100+ % boolElim, not, intToBool, boolOp, div, mod, strHead, strTail,
75− strCons, strIndex, reverse, null, getArgs, getEnv, setEnv,
101+ % strCons, strIndex, reverse, null, getArgs, getEnv, setEnv,
76− unsetEnv, getEnvironment, exit, usleep, sequence, toHexDigit,
102+ % unsetEnv, getEnvironment, exit, usleep, sequence, toHexDigit,
77− b8ToString, b16ToString, b32ToString, b64ToString, tail, head,
103+ % b8ToString, b16ToString, b32ToString, b64ToString, tail, head,
78− last, init, index, deleteAt, replaceAt, take, drop, fromList,
104+ % last, init, index, deleteAt, replaceAt, take, drop, fromList,
79− replicate, zipWith, zip, unzip, concat, elemBy, elem, lookupBy,
105+ % replicate, zipWith, zip, unzip, concat, elemBy, elem, lookupBy,
80− lookup, hasAnyBy, hasAny, find, findIndex, elemIndexBy, elemIndex,
106+ % lookup, hasAnyBy, hasAny, find, findIndex, elemIndexBy, elemIndex,
81− nubBy, nub, isPrefixOfBy, isPrefixOf, isSuffixOfBy, isSuffixOf,
107+ % nubBy, nub, isPrefixOfBy, isPrefixOf, isSuffixOfBy, isSuffixOf,
82− catMaybes, diag, range, isLeft, isRight, choose, either, lefts,
108+ % catMaybes, diag, range, isLeft, isRight, choose, either, lefts,
83− rights, partitionEithers, fromEither, maybeToEither, strM, unpack,
109+ % rights, partitionEithers, fromEither, maybeToEither, strM, unpack,
84− pack, span, break, split, ltrim, trim, words, lines, foldr1,
110+ % pack, span, break, split, ltrim, trim, words, lines, foldr1,
85− unwords, length, realPart, imagPart, mkPolar, cis, magnitude,
111+ % unwords, length, realPart, imagPart, mkPolar, cis, magnitude,
86− phase, conjugate, isNothing, isJust, maybe, fromMaybe, toMaybe,
112+ % phase, conjugate, isNothing, isJust, maybe, fromMaybe, toMaybe,
87− justInjective, lowerMaybe, raiseToMaybe, isNil, isCons, head,
113+ % justInjective, lowerMaybe, raiseToMaybe, isNil, isCons, head,
88− tail, last, init, take, drop, takeWhile, dropWhile, list, length,
114+ % tail, last, init, take, drop, takeWhile, dropWhile, list, length,
89− repeat, replicate, zipWith, zipWith3, zip, zip3, unzip, unzip3,
115+ % repeat, replicate, zipWith, zipWith3, zip, zip3, unzip, unzip3,
90− mapMaybe, toList, reverse, intersperse, intercalate, elemBy, elem,
116+ % mapMaybe, toList, reverse, intersperse, intercalate, elemBy, elem,
91− lookupBy, lookup, hasAnyBy, hasAny, find, findIndex, findIndices,
117+ % lookupBy, lookup, hasAnyBy, hasAny, find, findIndex, findIndices,
92− elemIndexBy, elemIndex, elemIndicesBy, elemIndices, filter, nubBy,
118+ % elemIndexBy, elemIndex, elemIndicesBy, elemIndices, filter, nubBy,
93− nub, span, break, split, partition, isPrefixOfBy, isPrefixOf,
119+ % nub, span, break, split, partition, isPrefixOfBy, isPrefixOf,
94− isSuffixOfBy, isSuffixOf, sorted, mergeBy, merge, sort,
120+ % isSuffixOfBy, isSuffixOf, sorted, mergeBy, merge, sort,
95− maybeToList, listToMaybe, catMaybes, appendNilRightNeutral,
121+ % maybeToList, listToMaybe, catMaybes, appendNilRightNeutral,
96− appendAssociative, lengthAppend, mapPreservesLength,
122+ % appendAssociative, lengthAppend, mapPreservesLength,
97− mapDistributesOverAppend, mapFusion, hasAnyByNilFalse,
123+ % mapDistributesOverAppend, mapFusion, hasAnyByNilFalse,
98− hasAnyNilFalse, fromIntegerNat, toIntegerNat, hyper, log2, gcd,
124+ % hasAnyNilFalse, fromIntegerNat, toIntegerNat, hyper, log2, gcd,
99− liftA, liftA2, liftA3, guard, when, finToNat, finToInt, weaken,
125+ % liftA, liftA2, liftA3, guard, when, finToNat, finToInt, weaken,
100− strengthen, last, natToFin, integerToFin, fromInteger, flatten,
126+ % strengthen, last, natToFin, integerToFin, fromInteger, flatten,
101− return, isUpper, isLower, isAlpha, isDigit, isAlphaNum, isSpace,
127+ % return, isUpper, isLower, isAlpha, isDigit, isAlphaNum, isSpace,
102− isNL, toUpper, toLower, isHexDigit, isValidHeap, merge, insert,
128+ % isNL, toUpper, toLower, isHexDigit, isValidHeap, merge, insert,
103− findMinimum, deleteMinimum, toList, fromList, sort, main, foldl,
129+ % findMinimum, deleteMinimum, toList, fromList, sort, main, foldl,
104− concat, concatMap, and, or, any, all, sum, product, Vars,
130+ % concat, concatMap, and, or, any, all, sum, product, Vars,
105− getAction, setInfo, getInfo, lift, output, queryVars, postVars,
131+ % getAction, setInfo, getInfo, lift, output, queryVars, postVars,
106− cookieVars, queryVar, getOutput, getHeaders, flushHeaders, flush,
132+ % cookieVars, queryVar, getOutput, getHeaders, flushHeaders, flush,
107− getVars, getContent, getCgiEnv, runCGI},
133+ % getVars, getContent, getCgiEnv, runCGI, mult
134+ },
108%% ---------------------------------------------------------------- [ Comments ]
135%% ---------------------------------------------------------------- [ Comments ]
109 morecomment=[l]--,%
136 morecomment=[l]--,%
110− morecomment=[n]{\{-}{-\}},
137+ morecomment=[n]{\{-}{-\}}
111−%% ---------------------------------------------------------- [ Literate Stuff ]
112− literate={+}{{$+$}}1
113− {/}{{$/$}}1
114− {*}{{$*$}}1
115− {=}{{$=$}}1
116− {>}{{$>$}}1
117− {<}{{$<$}}1
118− {\\}{{$\lambda$}}1
119− {\\\\}{{\char`\\\char`\\}}1
120− {->}{{$\rightarrow$}}2
121− {>=}{{$\geq$}}2
122− {<-}{{$\leftarrow$}}2
123− {<=}{{$\leq$}}2
124− {=>}{{$\Rightarrow$}}2
125− {\ .}{{$\circ$}}2
126− {\ .\ }{{$\circ$}}2
127− {>>}{{>>}}2
128− {>>=}{{>>=}}2
129− {|}{{$\mid$}}1,
130}[keywords,comments,strings]%
138}[keywords,comments,strings]%
131
139
140+%% ---------------------------------------- [ Define Idris with Literate Stuff ]
141+\lstdefinelanguage{literateidris}[]{idris}{
142+ literate= {+}{{$+$}}1
143+ {/}{{$/$}}1
144+ {*}{{$*$}}1
145+ {=}{{$=$}}1
146+ {>}{{$>$}}1
147+ {<}{{$<$}}1
148+ {\\}{{$\lambda$}}1
149+ {\\\\}{{\char`\\\char`\\}}1
150+ {->}{{$\rightarrow$}}2
151+ {>=}{{$\geq$}}2
152+ {<-}{{$\leftarrow$}}2
153+ {<=}{{$\leq$}}2
154+ {=>}{{$\Rightarrow$}}2
155+ {==}{{$\equiv$}}2
156+ {\ .}{{$\circ$}}2
157+ {\ .\ }{{$\circ$}}2
158+ {>>}{{>>}}2
159+ {>>=}{{>>=}}2
160+ {|}{{$\mid$}}1,
161+}
132%% -------------------------------------------------- [ Default Listings Style ]
162%% -------------------------------------------------- [ Default Listings Style ]
133−%% Provide a default styling for Idris listings. Use is optional.
163+
134−\newcommand{\IdrisListingsDefaultStyle}
164+\lstdefinestyle{default}{%
135−{%
165+ xleftmargin=\parindent,
136− \lstset{%
166+ tabsize=2
137− language=idris,
167+}
168+\lstdefinestyle{numbers}{%
169+ xleftmargin=\parindent,
138− tabsize=2,
170+ tabsize=2,
139− numbers=left,
171+ numbers=left,
172+ numbersep=10pt,
140− numberstyle=\tiny,
173+ numberstyle=\footnotesize\sffamily,
141− frame=leftline
174+ frame=leftline
142− }
143}
175}
144
176
145%% ------------------------------------------------------ [ A Code Environment ]
177%% ------------------------------------------------------ [ A Code Environment ]
146−%% Replicate the existence of literate haskell code environments, but
178+%% Replicate the existence of literate haskell code environments,
147−%% make them pretty when compiled to pdf.
179+%% option to make pretty with numbers.
148−\lstnewenvironment{code}
180+\lstnewenvironment{code}[1][]
149− {\lstset{%
181+ {\ifthenelse{\boolean{literate}}{%
182+ \lstset{language=literateidris}}{%
150− language=idris,
183+ \lstset{language=idris}}
151− tabsize=2,
184+ \ifthenelse{\boolean{numbers}}{%
152− numbers=left,
185+ \lstset{style=numbers, #1}}{%
153− numberstyle=\tiny,
186+ \lstset{style=default, #1}}
154− frame=leftline
155− }
156 }
187 }
157 {}
188 {}
158\endinput
189\endinput
libs/Makefile+12−12
@@ -1,20 +1,20 @@
1build: .PHONY
1build: .PHONY
2− make -C prelude build
2+ $(MAKE) -C prelude build
3− make -C base build
3+ $(MAKE) -C base build
4− make -C effects build
4+ $(MAKE) -C effects build
5− make -C javascript build
5+ $(MAKE) -C javascript build
6
6
7
7
8install: .PHONY
8install: .PHONY
9− make -C prelude install
9+ $(MAKE) -C prelude install
10− make -C base install
10+ $(MAKE) -C base install
11− make -C effects install
11+ $(MAKE) -C effects install
12− make -C javascript install
12+ $(MAKE) -C javascript install
13
13
14clean: .PHONY
14clean: .PHONY
15− make -C prelude clean
15+ $(MAKE) -C prelude clean
16− make -C base clean
16+ $(MAKE) -C base clean
17− make -C effects clean
17+ $(MAKE) -C effects clean
18− make -C javascript clean
18+ $(MAKE) -C javascript clean
19
19
20.PHONY:
20.PHONY:
libs/prelude/Prelude.idr+7
@@ -236,6 +236,10 @@ instance Applicative (Vect k) where
236
236
237 fs <$> vs = zipWith ($) fs vs
237 fs <$> vs = zipWith ($) fs vs
238
238
239+instance Applicative Stream where
240+ pure = repeat
241+ (<$>) = zipWith ($)
242+
239---- Alternative instances
243---- Alternative instances
240
244
241instance Alternative Maybe where
245instance Alternative Maybe where
@@ -271,6 +275,9 @@ instance Monad List where
271instance Monad (Vect n) where
275instance Monad (Vect n) where
272 m >>= f = diag (map f m)
276 m >>= f = diag (map f m)
273
277
278+instance Monad Stream where
279+ s >>= f = diag (map f s)
280+
274---- Traversable instances
281---- Traversable instances
275
282
276instance Traversable Maybe where
283instance Traversable Maybe where
libs/prelude/Prelude/Stream.idr+42
@@ -1,10 +1,52 @@
1module Prelude.Stream
1module Prelude.Stream
2
2
3+import Prelude.Functor
3import Prelude.Vect
4import Prelude.Vect
4
5
6+%access public
7+%default total
8+
5codata Stream : Type -> Type where
9codata Stream : Type -> Type where
6 (::) : a -> Stream a -> Stream a
10 (::) : a -> Stream a -> Stream a
7
11
12+instance Functor Stream where
13+ map f (x::xs) = f x :: map f xs
14+
15+head : Stream a -> a
16+head (x::xs) = x
17+
18+tail : Stream a -> Stream a
19+tail (x::xs) = xs
20+
8take : (n : Nat) -> Stream a -> Vect n a
21take : (n : Nat) -> Stream a -> Vect n a
9take Z _ = []
22take Z _ = []
10take (S n) (x :: xs) = x :: (take n xs)
23take (S n) (x :: xs) = x :: (take n xs)
24+
25+%assert_total
26+drop : Nat -> Stream a -> Stream a
27+drop Z xs = xs
28+drop (S k) (x::xs) = drop k xs
29+
30+repeat : a -> Stream a
31+repeat x = x :: repeat x
32+
33+iterate : (a -> a) -> a -> Stream a
34+iterate f x = x :: iterate f (f x)
35+
36+index : Nat -> Stream a -> a
37+index Z (x::xs) = x
38+index (S k) (x::xs) = index k xs
39+
40+zipWith : (a -> b -> c) -> Stream a -> Stream b -> Stream c
41+zipWith f (x::xs) (y::ys) = f x y :: zipWith f xs ys
42+
43+zip : Stream a -> Stream b -> Stream (a, b)
44+zip = zipWith (\x,y => (x,y))
45+
46+unzip : Stream (a, b) -> (Stream a, Stream b)
47+unzip xs = (map fst xs, map snd xs)
48+
49+diag : Stream (Stream a) -> Stream a
50+diag ((x::xs)::xss) = x :: diag (map tail xss)
51+
52+
src/Idris/AbsSyntax.hs+6−3
@@ -577,9 +577,12 @@ setColour ct c = do i <- getIState
577logLvl :: Int -> String -> Idris ()
577logLvl :: Int -> String -> Idris ()
578logLvl l str = do i <- getIState
578logLvl l str = do i <- getIState
579 let lvl = opt_logLevel (idris_options i)
579 let lvl = opt_logLevel (idris_options i)
580− when (lvl >= l)
580+ when (lvl >= l) $
581+ case idris_outputmode i of
581− $ do runIO (putStrLn str)
582+ RawOutput -> do runIO $ putStrLn str
582− putIState $ i { idris_log = idris_log i ++ str ++ "\n" }
583+ IdeSlave n ->
584+ do let good = SexpList [IntegerAtom (toInteger l), toSExp str]
585+ runIO $ putStrLn $ convSExp "log" good n
583
586
584cmdOptType :: Opt -> Idris Bool
587cmdOptType :: Opt -> Idris Bool
585cmdOptType x = do i <- getIState
588cmdOptType x = do i <- getIState
src/Idris/AbsSyntaxTree.hs+1−2
@@ -97,7 +97,6 @@ data IState = IState {
97 idris_calledgraph :: Ctxt [Name],
97 idris_calledgraph :: Ctxt [Name],
98 idris_docstrings :: Ctxt String,
98 idris_docstrings :: Ctxt String,
99 idris_totcheck :: [(FC, Name)],
99 idris_totcheck :: [(FC, Name)],
100− idris_log :: String,
101 idris_options :: IOption,
100 idris_options :: IOption,
102 idris_name :: Int,
101 idris_name :: Int,
103 idris_lineapps :: [((FilePath, Int), PTerm)],
102 idris_lineapps :: [((FilePath, Int), PTerm)],
@@ -185,7 +184,7 @@ data IBCWrite = IBCFix FixDecl
185idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
184idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
186 emptyContext emptyContext emptyContext emptyContext
185 emptyContext emptyContext emptyContext emptyContext
187 emptyContext emptyContext emptyContext emptyContext
186 emptyContext emptyContext emptyContext emptyContext
188− [] "" defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
187+ [] defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
189 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
188 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
190 True defaultTheme stdout
189 True defaultTheme stdout
191
190
src/Idris/REPL.hs+1−1
@@ -1157,7 +1157,7 @@ idrisMain opts =
1157
1157
1158 when runrepl $ initScript
1158 when runrepl $ initScript
1159 stvar <- runIO $ newMVar ist
1159 stvar <- runIO $ newMVar ist
1160− when runrepl $ startServer ist stvar inputs
1160+ when (runrepl && not idesl) $ startServer ist stvar inputs
1161 when (runrepl && not idesl) $ runInputT (replSettings (Just historyFile)) $ repl ist stvar inputs
1161 when (runrepl && not idesl) $ runInputT (replSettings (Just historyFile)) $ repl ist stvar inputs
1162 when (idesl) $ ideslaveStart ist inputs
1162 when (idesl) $ ideslaveStart ist inputs
1163 ok <- noErrors
1163 ok <- noErrors
tutorial/idrislang.sty+2
@@ -166,6 +166,8 @@
166 tabsize=2
166 tabsize=2
167}
167}
168\lstdefinestyle{numbers}{%
168\lstdefinestyle{numbers}{%
169+ xleftmargin=\parindent,
170+ tabsize=2,
169 numbers=left,
171 numbers=left,
170 numbersep=10pt,
172 numbersep=10pt,
171 numberstyle=\footnotesize\sffamily,
173 numberstyle=\footnotesize\sffamily,