on master help sign in
Merge pull request #2001 from adamse/provided-postulates-docs
6676b85David Christiansen
src/Idris/Elab/Provider.hs+1−5
@@ -98,11 +98,7 @@ elabProvider doc info syn fc what n
98 logLvl 3 $ "Elaborated provider " ++ show n ++ " as: " ++ show tm
98 logLvl 3 $ "Elaborated provider " ++ show n ++ " as: " ++ show tm
99 | ProvPostulate _ <- what ->
99 | ProvPostulate _ <- what ->
100 do -- Add the postulate
100 do -- Add the postulate
101− elabPostulate
101+ elabPostulate info syn doc fc [] n (delab i tm)
102− info syn
103− (fmap (const (Left $ Msg "")) .
104− parseDocstring $ T.pack "Provided postulate")
105− fc [] n (delab i tm)
106 logLvl 3 $ "Elaborated provided postulate " ++ show n
102 logLvl 3 $ "Elaborated provided postulate " ++ show n
107 | otherwise ->
103 | otherwise ->
108 ierror . Msg $ "Attempted to provide a postulate where a term was expected."
104 ierror . Msg $ "Attempted to provide a postulate where a term was expected."
test/docs002/docs002.idr+4
@@ -12,5 +12,9 @@ getType _ = return (Provide Bool)
12
12
13||| Some documentation
13||| Some documentation
14%provide (T1 : Type) with getType 0
14%provide (T1 : Type) with getType 0
15+
15||| Some other documentation
16||| Some other documentation
16%provide (T2 : Type) with getType 1
17%provide (T2 : Type) with getType 1
18+
19+||| Some provided postulate
20+%provide postulate T3 with getType 0
test/docs002/expected+3
@@ -5,4 +5,7 @@ Type checking ./docs002.idr
5*docs002> T2 : Type
5*docs002> T2 : Type
6 Some other documentation
6 Some other documentation
7
7
8+*docs002> T3 : Int
9+ Some provided postulate
10+
8*docs002> Bye bye
11*docs002> Bye bye
test/docs002/input+1
@@ -1,2 +1,3 @@
1:doc T1
1:doc T1
2:doc T2
2:doc T2
3+:doc T3