ghc Questions
2
Is there a way to limit ghc's memory usage during compilation, without compromising code quality? I am on a 2GB machine, and it literally halts during builds. GHC version 7.10.3, Ubuntu 14.04, 4GB ...
3
Solved
Is it possible to use CPP extension on Haskell code which contains multiline string literals? Are there other conditional compilation techniques for Haskell?
For example, let's take this code:
--...
Monochrome asked 30/3, 2010 at 22:26
1
Solved
I tend to stick to "recommended" versions:
┌──────────────────────────────────GHCup──────────────────────────────────┐
│ Tool Version Tags Notes │
│───────────────────────────────────────...
1
Solved
I'm new to Haskell and learning about Monad Transformer. I found that lift can be omitted when operating on an inner monad in a monad stack. For example:
type Foo = ReaderT String (WriterT String I...
2
Solved
I experimented with the closureSize# primitive in GHC. Here I define the helper function I use (x is forced using a bang pattern, so what I am measuring should be the data constructor closures them...
9
Solved
Is there a reasonably fast way to extract the exponent and mantissa from a Number in Javascript?
AFAIK there's no way to get at the bits behind a Number in Javascript, which makes it seem to me th...
Datha asked 21/2, 2012 at 19:9
3
Solved
when I type stack run I get no error message but when I type stack ghci I get this error about multiple files use the same name , how I can solve it ?
(base) wejden@wejdenaydi:~/wejden$ stack ghci
...
Biscuit asked 13/5, 2021 at 13:12
2
Solved
Based on my previous question I'd like to ask if there's any way to kill all user created threads in a GHCi session?
The reason for this is that when a function exits in GHCi the threads that it s...
Scrunch asked 28/7, 2014 at 16:19
1
Solved
Data.Dynamic has the following implementation:
data Dynamic where
Dynamic :: TypeRep a -> a -> Dynamic
It has occurred to me that the following definition would be equivalent (at least I th...
5
Solved
When I prototype Haskell programs, I always get hundreds of warnings like this (not joking):
/Users/bob/SourceCode/course/is/expriment/LiftedSpine2.hs:70:15:
Warning: Defined but not used: `ta'
...
0
I have some C source code that I am calling from Haskell using ccall FFI. To make the build process as easy as possible, I'd like to use Cabal to compile the C files, so I've added the sources to t...
2
Solved
Every now and again I have been noticing the following in Haskell documentation:
(for example in Data.Text):
Subject to fusion
What is fusion and how do I use it?
Comity asked 11/8, 2016 at 20:17
5
Is there a way how to ask gmake to never run two targets from a set in parallel?
I don't want to use .NOTPARALLEL, because it forces the whole Makefile to be run sequentially, not just the require...
Redon asked 17/2, 2014 at 14:45
1
With GHC 8.10 and 9.0 foo (a :: Aaa) was enough to disambiguate which field I want to use.
Since 9.2 I now get a warning (ambiguous-fields):
The field ‘foo’ belonging to type Aaa is ambiguous.
Th...
4
Solved
I'm trying to install GHC with ghcup on an windows laptop running an Ubuntu subsystem. I keep getting the same error and I don't even really know what is going wrong. Here are the error messages:
[...
4
Solved
I am trying to install the Haskell Platform on Linux for the first time (I'm also a fairly new Linux user). The victim system is a fresh Red Hat system. And everything involved here should be 64 bi...
Corelation asked 15/6, 2011 at 16:0
1
Lets say I have the following (contrived example) for the function f:
data T where
T :: (Typeable a, Integral a) => { first :: a, second :: a } -> T
printType :: forall a. Typeable a => ...
2
Solved
Both 1 and "hello" are in normal form, thus are not thunks. So why does GHCi show that "hello" is a thunk?
ghci> x = 1::Int
ghci> :sprint x
x = 1
ghci> x = "hello...
Boaster asked 16/5, 2023 at 13:9
1
Solved
The wikibook says that: in this expression
let z = (length [1..5], reverse "olleh") in ...
z is a thunk.
But this stackoverflow post says that the outermost layer of z is the data constr...
Orangewood asked 16/5, 2023 at 11:49
2
I am trying to set an enverionment for Haskell and I installed stack. After the installation I realized the GHC 8.6.4 version is not the one that I need (8.0.2).
compiler-exe: /home/manny/.stack/...
Salcedo asked 27/4, 2019 at 7:52
2
Solved
I have a fairly complex and performance-critical Haskell program. I have used cost center profiling to optimize to the point where there are no major remaining hot spots. Furthermore, the program r...
1
A question from yesterday had a definition of HList (from the HList package) that uses data families. Basically:
data family HList (l :: [*])
data instance HList '[] = HNil
newtype instance HList ...
1
Solved
How can I do one of the following?
get a list of ThreadIDs all running forked threads (preferably with labels) from application code?
get a simple (maybe approximate; e.g. from the last major GC),...
1
Solved
When using random-fu 0.3.0.0 I get confused exploring the types for random.
Checking with :t I get
ghci> :t Data.Random.sample
Data.Random.sample
:: (Data.Random.Distribution d t, Data.Random.S...
1
Solved
Consider the following module:
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DefaultSignatures #-}
module Lib where
import Data.List (foldl')
doBig...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.