StackOverflowHaskell
@SO_Haskell
Followers
578
Following
2
Media
9
Statuses
55K
bot :: (StackOverflow a, CodeReview.SE b, Programmers.SE c) ⇒ a → b → c → TweetIO ()
Joined October 2012
Performance difference of function and data recursion in Haskell While thinking about this other question, I realized that the following functions smoothSeq and smoothSeq' smoothSeq :: (Integer, Integer, Integer) -> [Integer] smoothSeq (a,…
0
0
1
Does this Haskell code reuse previous computation? I have a piece of Haskell code that computes regular numbers, i.e. positive integers whose only prime factors can be 2, 3 or 5. The algorithm is straightforward and follows what's suggested…
0
0
1
Haskell: the index of a maximum element in an Array Given an Array, I need to compute the index of the maximum element (which is assumed to be unique). My current attempt is: maxIndex' :: (Ix i, Ord a) => Array i a -> [i] -> i -> a -> i -…
0
0
0
Haskell BFS Maze solver doesn't find a solution I've been trying to learn Haskell by creating a few simple programs. Today I decided to try a simple maze solver in Haskell. The program runs but it doesn't find a solution. Here's my implemen…
0
0
0
Applicative and Effectful Programming Explanation Am currently reading through some chapters regarding applicative and effectful programming Chapters begins with functors which I understand as instead of mapping a specific data structure t…
0
0
0
How to persist an object in Haskell to a memory location via unsafePerformIO or similar In a Haskell system I don't have much control over, I provide a syntactically pure function with the following signature: doTheWork :: Int -> TheInput …
0
0
0
Emacs `haskell-compile` for unit tests Emacs newbie here, transitioning from Neovim. I have a project in Haskell, and I am aware that I can run haskell-compile and it will execute cabal build. 2 questions please: What can I do if I need ca…
0
0
0
What is issue/feature 150 in Parsec? I am looking through the parsec github repository (currently at version 3.1.16.1) on the master branch. As of the time of writing this, the latest commit on master has commit id 1f542120d9adc5e22f8791a6d…
0
0
0
Difficulty in trying to implement a type-safe `at` for length-indexed vectors I have just learnt about the DataKinds extension, type-level literals, and found out that type-levels natural numbers can be compared using constraints provided i…
0
0
0
Haskell Image Processing I'm new to haskell and I've been struggling to get this code running. The code is basically supposed to be a convolution for image processing... import Codec.Picture -- Apply a convolution filter to an image apply…
0
0
0
Is there a way to tell Haskell runtime to use cache for functions with approximately the same inputs? I have a Haskell function that takes several floats as inputs. This function is somewhat expensive to calculate, so it would be really nic…
0
0
0
Case on a set ignores equality/inequality Pattern-matching is based on Eq instance, right? I see that Data.Set.Set implements Eq and >S.fromList [] == S.fromList [1,2] False >S.fromList [1,2] == S.fromList [2,1] True which is right. Then …
0
0
0
haskell specifying ordered list in type signature In haskell I can specify with type signature of function f that pair must be ordered in this way: {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGU…
0
0
0
How do I get the input consumed by a parser in Parsec? TL;DR: Is there a simple way for me to get the input stream consumed by a parser? Perhaps there is a way using the getInput, getPosition, and parsecMap utilities provided by parsec? I …
0
0
0
I'm confused by Haskell's thunks 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 constructor (,), which i…
0
0
0
"Is "hello" a thunk or in normal form? 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"::String ghci> :sprint x x = _ …
0
0
0
How do I pass C compiler flags in a Haskell Stack package.yaml I'm working on a Haskell project involving some FFI, and I keep making small typos in the names of C functions in my Haskell code, which due to implicit function declaration, re…
0
0
0
Bowling game in haskell please help me [closed] enter image description here enter image description here I don'n know how to do it
0
0
0
Sharing data in Haskell I would like to understand how the memory sharing mechanism works in Haskell. Indeed, a way to program a function calculating the terms of the fibonnaci sequence is: fibo' n = f n where f 0 = 1 f 1 = 1 …
0
0
0
trying to implement tail function in haskell? as a part of learning Haskell, i'm trying to implement my own version of various functions related to list, here my impleentation of tail function so far tail' :: [a] -> [a] tail' [a] = [] tail…
0
0
0