Skip to main content
1 vote
1 answer
36 views

I cannot fix this error. build.sh is trying to create a shared library but it fails: ~/Desktop/deepseek$ ./build.sh Building Haskell shared library... Loaded package environment from /home/success/....
success moses's user avatar
-3 votes
1 answer
107 views

I need help with some haskell syntax. I have a really long type signature and I need a quick way of making sure that the parts of it which are equal are represented in the signature itself. Signature: ...
kesarling's user avatar
  • 2,318
2 votes
1 answer
54 views

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 #-} {-# ...
davidg's user avatar
  • 63
1 vote
2 answers
115 views

Here is the question from Mitchell Wand's Essentials of Programming Language: Exercise 1.19 [⋆ ⋆] (list-set lst n x) returns a list like lst, except that the n-th element, using zero-based indexing, ...
YCH817's user avatar
  • 123
-1 votes
1 answer
120 views

I need a function of type linearJoin :: (ctx,Functor n,Functor m,Functor x) => (forall a. n (m a) -> x a) -> t n (t m a) -> t x a A bind version would look like this linearBind bindfun f k ...
Ashok Kimmel's user avatar
2 votes
4 answers
199 views

I'm looking into associated type families. As an own learning example, I try to model a small part of the x86 assembly language. This compiles: {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ...
Jogger's user avatar
  • 1,783
Advice
0 votes
4 replies
126 views

In Haskell, how should one test the equality of two infinite lists? With finite lists, one might try: listEqual :: Eq a => [a] -> [a] -> Bool listEqual l0 l1 = and $ zipWith (==) l0 l1 But ...
Geoffrey Warne's user avatar
4 votes
2 answers
111 views

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 ...
davidg's user avatar
  • 63
0 votes
1 answer
79 views

So this is the data definition and my function. Task 3 Define addAll, which adds a list of expressions together into a single expression without introducing any 'junk'. You could use foldr since it ...
charlotte chang's user avatar
Best practices
5 votes
3 replies
150 views

I had a nice idea of using applicative for nondeterministic financial modelling. Or maybe it is a simple case of sentization. So the basic example is to define newtype ValueRange. newtype ValueRange a ...
Dominik G's user avatar
  • 614
5 votes
2 answers
152 views

Fur fun and education I'm trying to write a mini compiler with the final tagless method as described by Oleg Kiselyov in his paper Typed Tagless Final Interpreters. My grammar has expressions and ...
Jogger's user avatar
  • 1,783
5 votes
1 answer
140 views

Consider this Haskell code that compiles successfully: {-# LANGUAGE RankNTypes #-} -- Applies a polymorphic function to different types, expecting 3 constraints applyToMany :: (forall a. (Show a, Eq ...
Thomas's user avatar
  • 6,364
4 votes
1 answer
115 views

The following program assumes that /path/to/mypipe is a named pipe, e.g. created via mkfifo /path/to/mypipe, with no readers/writers waiting yet, runs two threads, of which the main thread keeps ...
Enlico's user avatar
  • 30.3k
0 votes
1 answer
154 views

MRE: module Temp where data Some r a = Thing r a instance Monad (Some r) where return :: a -> Some r a return a = Thing r a -- <- The is a phantom argument (somewhat like the s in ...
kesarling's user avatar
  • 2,318
2 votes
2 answers
177 views

Suppose, we have 2 lists of lists: a = [[1,2], [3,4]] b = [[5,6], [7,8]] We want to merge every element of the first list with every element of the second list and get: c = [[1,2,5,6], [1,2,7,8], [3,...
user4035's user avatar
  • 24k

15 30 50 per page
1
2 3 4 5
3454