I recently started learning Haskell and encountered a problem with the idea of Applicative. I need to make an implementation for newtype MyTriple a = MyTriple (
I have checked out https://github.com/gitpod-io/template-haskell and merged samples for a book (haskell in depth) into my branch. Prebuilding has no effect, eve
In Haskell there is a simple list function available iterate :: (a -> a) -> a -> [a] iterate f x = x : iterate f (f x) In python it could be implemen
I'm making drawings with the Haskell cairo binding and I want to align some object vertically. To do that, I need to know the width (the bounding box or partial
I'm trying to write Applicative for this type data Choice a = ColumnA a | ColumnB a I wrote a Functor instance: instance Functor Choice where fmap f (Co
I am pretty new to Haskell, and I was wondering if one can define new types that are defined by lists of other types. For example, I assume a string is defined
I have an instance of Num for a type I created called Vec: instance Num Vec where (+) (Vec x) (Vec y) = Vec (zipWith (+) x y) And I am trying to write a test
I have the following code which uses Newton's method to approximate the square root of some number. The problems is that when I run it, I get an error..What is
Is there anything in Haskell resembling the following type class? class Mergeable (f :: Type -> Type -> Type) where merge :: f a b -> f c d -> f (
Still not a hundred percent shure how to make instances of the more complex types. Have this: data CouldBe a = Is a | Lost deriving (Show, Ord) Made an ins
As an exercise in learning Haskell I've written an interpreter for the CESIL language (an old, very basic, educational low level language). It works, but compar
minimumBy takes as the first parameter a function that should be used to compare two elements. comparing is a higher-order function that can be used to transfor
I'm trying to make Twice a member of applicative, but I am getting "Conflicting definitions for `a'" in the functor implementation: Also I'm not sure how to imp
I'm learning Haskell and trying to do exercises from book Haskell Programming from first principles and I'm stack trying to write applicative for Pair type da
How would I configure stack to use an older resolver by default? I know the resolver can be specified on the command line at build time and per project in the
For example: map (+1) 2 in ghci yields <interactive>:23:1: error: * Non type-variable argument in the constraint: Num [b] (Use FlexibleContexts to
I am trying to understand why my haskell function returns a nested tuple, and I cannot seem to wrap my head around the problem. I have this function that genera
Can I, and if so, how do I, write the type signature for a function: g f x y = (f x, f y) Such that given: f1 :: a -> [a] f1 x = [x] x1 :: Int x1 = 42
Is it possible to install a version of a package from github using Haskell stack? e.g. in a .cabal or a stack.yaml file, how can I point a dependency at a git
To get the symmetric difference of two lists I think it would be a good idea to use list comprehension. But I don't know what I could do to remove the common el