2,538 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
0
answers
102
views
Stack for Haskell unable to remove files?
I am a beginner Haskell programmer on Windows 11. I am writing a Snakes & Ladders program, and am attempting to set up a Stack environment to work in.
I have been following this guide, as well as ...
5
votes
2
answers
284
views
Ensuring specialization while preventing inlining
disjointCollisions :: Eq k => Word -> Array (Leaf k a) -> Word -> Array (Leaf k b) -> Bool
I would like this function to be specialized (to arbitrary unknown key types k) but never ...
2
votes
1
answer
67
views
ghc gives error for something that's allowed in GHC.Internal.System.Posix.Internals
The following program gets the error:
"Illegal term-level use of the type constructor or class ‘IOError’"
even though it's right out of the source to ghc:
{-# LANGUAGE Trustworthy #-}
{-# ...
4
votes
2
answers
113
views
GHC can't avoid module cycle with class definitions
Problem: Can't avoid a module cycle with class definitions in Haskell.
Foo.hs contains:
module Foo where
import {-# SOURCE #-} Bar
class FooClass a where
...
myBar :: BarClass -> a -- use a ...
1
vote
1
answer
84
views
Under what circumstances can a write to a Haskell unsafeThaw-ed array/vector result in a segfault (via lost GC root)?
This question tries to collect the full picture if/when a stale object reference can happen from an old-gen (immutable) array referring a newer-gen object, from fragments of information.
Preface: was ...
3
votes
2
answers
108
views
Does GHC specialize data constructors, or how to design for such a usecase
I'm familiar with the SPECIALIZE pragma, or INLINE/INLINABLE that might enable automatic specialization at the use-site. But those are about specializing functions for type variables taking special ...
2
votes
2
answers
107
views
Cabal not recognizing Include/Header File Directories for FFI project
So I have a project in Haskell, and I was using make to build it, but then I switched the project over to use Cabal as someone recommended to me on another Stack Overflow post. It is an FFI project, ...
2
votes
1
answer
57
views
GHC(Haskell) not picking up imports from makefile
I have been making a Haskell project that I want to continue on in C at some point through the FFI. I wanted to create a makefile to compile all the source with Clang for C and GHC for Haskell.
The ...
7
votes
2
answers
223
views
What is wrong with this closed type family in GHC2021-GHC2024 as compared to Haskell2010?
In Haskell in Depth, Chapter 11, there's an example aimed at avoiding character escaping in GHCi, which is what happens automatically when you enter print "ë", as it'll be printed like "...
7
votes
1
answer
197
views
Redundant pattern matching slowing down our Haskell program
We are working on some programs that do rewriting logic, where there is a
state (often complex), a set of rules that match certain patterns in this
state, and strategy for applying these rules to ...
cjs's user avatar
- 27.9k
2
votes
1
answer
73
views
GHC.Record : Record data type may not be a data family
I would like to create a virtual record field "r" for the red component of a color using the Color package. This package uses a data family Color.
I tried to write the following :
import GHC....
4
votes
1
answer
126
views
What does `break<N>` mean in GHC Core?
Using GHC 9.6.2 and looking at the GHC Core output, I see a lot of
break<N>, where N is a small integer. What does this mean?
For example, from a source definition:
type Store = Map Id Integer
...
cjs's user avatar
- 27.9k
4
votes
2
answers
120
views
How to understand constraints of PFunctor in categories library
How to understand p r -> t and p t -> r in PFunctor p r t | p r -> t, p t -> r?
https://github.com/ekmett/categories/blob/4a02808d28b275f59d9d6c08f0c2d329ee567a97/old/src/Control/...
2
votes
1
answer
80
views
How can GHC's fairness guarantee not show up if a thread is descheduled while it is not holding the MVar?
In Parallel and Concurrent Programming in Haskell by Simon Marlow, chapter 7 starts at page 125 with this example,
import Control.Concurrent
import Control.Monad
import System.IO
main :: IO ()
main = ...
1
vote
0
answers
50
views
Visual Studio Code Haskell extension fails to find ghc version
I get following error in VSCode:
However, when I run this command in shell manually it works fine:
% stack --stack-yaml /home/user/haskell/h5/stack.yaml exec ghc -- --numeric-version
9.8.2
My stack....