Questions tagged [haskell]
Haskell is a functional programming language featuring strong static typing, lazy evaluation, extensive parallelism and concurrency support, and unique abstraction capabilities.
45,678
questions
1
vote
0answers
17 views
Can cabal/stack/nix be used to compile into dynamic library?
I'm trying to build shared library containing exported ffi code into shared library. I wonder if it is possible to do it with common tools like stack or nix (so basically with cabal)? Is it? Then how?
...
-2
votes
1answer
44 views
Haskell check if the regular expression r made up of the single symbol alphabet Σ = {a} defines language L(r) = a*
I have got to write an algorithm programatically using haskell. The program takes a regular expression r made up of the unary alphabet Σ = {a} and check if the regular expression r defines the ...
0
votes
0answers
15 views
Trouble running ORC JIT llvm-hs examples
Dear StackOverflow Haskellers:
I tried asking this same question in reddit r/haskell but sadly I got no answers at all. I hope it does better here.
Maybe the answer is that llvm-hs isn't used that ...
-3
votes
0answers
25 views
Use hSetBuffering [closed]
I'm made this program in haskel that is supposed to receive a metric and a column number and then calculate result of the metrics apply to the entry given by the user. The metrics are sum of the ...
1
vote
0answers
30 views
Haskell plugin in Intellij Idea doesn't work
I'm using stack plugin in Intellij Idea and have all haskell tools installed and working, but every time I try to launch the program, I see this error:
REPL couldn't be started for target `proj:lib` ...
2
votes
0answers
53 views
How to generate a list of random Num elements without IO in Haskell [duplicate]
I need to generate list of random elements without IO monad, is there a way to do it?
I managed to do myself a random list generating function only with IO, here it is:
genRandList :: Random a => a ...
3
votes
1answer
43 views
Parsing a series of lambda calculus terms
I am writing a lambda calculus parser in Haskell and I can't find a solution to fix its current problem.
How I parse expressions:
expr :: Parser LamExpr
expr = do terms <- some $ token term
...
2
votes
1answer
63 views
How to return different types in the same function in haskell?
I cannot understand why, although I have declared the data types, the function does not accept the different return. I also tried to create a "Result" type but it was not enough to solve the ...
0
votes
1answer
54 views
Non-exhaustive pattern in function error despite the data handling being handled elsewhere
I'm trying to write a simple language and at the moment I'm trying to implement a loop but every time I run the program, I get an error that there's a non-exhaustive pattern in the evalStatement_ ...
2
votes
0answers
64 views
Haskell: How to apply partial order to a substring function?
I have implemented the class POrd and a substring function, which takes 2 strings and determines if the first string is a substring of the second input string.
Now I want to apply the POrd class to ...
3
votes
1answer
55 views
What is the proper way to use Nat/Natural in a singletons data type?
I am working on writing a prototype programming language in Haskell with polymorphic variants using the singletons library. I have a basic type of types that looks like this:
import Data.Singletons.TH
...
1
vote
0answers
16 views
How to get a list of fingerprints of certificates in a PKCS#7 structure?
I have a PKCS#7 structure with a list of certificates stored in a ByteString (originally read from a file). Now I would like to get the fingerprint for the certificates stored inside the structure. ...
2
votes
2answers
40 views
How to move all occurrences of the first element of the list to the end of the list in Haskell?
I want to extract the first element and all of its occurrences from a list and put them in the end of a list in Haskell
What I have now is this.
relegate [] = []
relegate (x:xs) = xs ++ [x]
With ...
2
votes
3answers
52 views
How to sum elements of two lists. Haskell
I'm only at the beginning of learning Haskell, and currently I'm exploring the possibilities of lists.
I wanted to sum up two lists, but somehow it went wrong.
So:
Input: sumTwoLists [2,5,7,7,9] [1,2,...
-2
votes
0answers
47 views
How can I make `elem` check my input between a list of 1-50 rather than 1-9? It rejects anything more than single digits
discLocation :: Grid -> IO Int
discLocation grid = do
putStrLn "Enter number from the grid "
value <- getLine
if value `elem` [1..50] && validSlot grid ...