Questions tagged [idris]

Idris is a general purpose pure functional programming language with dependent types.

Idris is a general-purpose purely functional programming language with dependent types, strict or optional lazy evaluation and features such as a totality checker.


Useful links:

785 questions
0
votes
1 answer

concat in zipWith "no such variable a"

Using zipWith with addition like following code, works fine: zipWith (\x,y => x + y) [1,2,3] [4,5,6] However, using concatenation instead with two lists of lists fails: zipWith (\xs,ys => xs ++ ys) [[1],[2],[3]] [[4],[5],[6]] with error: When…
Michelrandahl
  • 3,365
  • 2
  • 26
  • 41
0
votes
1 answer

Simple dependently typed Temperature converter in Haskell, is it possible to make this code shorter?

The function convert below has the type signature : SUnit fromUnit-> SUnit toUnit ->Value fromUnit -> Value toUnit, which has redundancy, because the same information could be expressed by : Value fromUnit -> Value toUnit. 1) Is there a way to…
jhegedus
  • 20,244
  • 16
  • 99
  • 167
0
votes
2 answers

Idris - Can't evaluate function application in type

I'm getting a problem where I have a value with type fun a, with fun being a function and a a value which doesn't get computed at type-checking and throws an unification error when I force it to be the result of that function application. The…
gonzaw
  • 771
  • 4
  • 17
0
votes
1 answer

Idris - Computation on types based on decidable property doesn't typecheck

I'm facing a problem in Idris, where I want to create a type-level "check" based on a decidable property, where if the property holds I get the type I want, but if the property fails I get Unit (()), signaling that the program is in an inconsistent…
gonzaw
  • 771
  • 4
  • 17
-1
votes
1 answer

Is there a specific syntax for pure keyword in idris?

I'm working on a function to read a list for user input and then create a tree from it. Here's the code readList : IO (Maybe BSTree a) readList = do x <- getLine if all isDigit (unpack input) then do (_ ** xs) <-…
Oneiros
  • 143
  • 1
  • 13
1 2 3
52
53