Category "haskell"

Writing Algebraic Data Type in Scala

In Haskell, I can define a Tree: data Tree a = Empty | Node a (Tree a) (Tree a) How could I write this in Scala? I'm not sure how to keep the type paramete

How does an instance of "Arbitrary" looks for a tree?

In our CS-Lectures we currently learn about QuickCheck in Haskell. Now I got a task to use QuickCheck with the following tree-type: data Tree = Leaf Int | Node

What exactly does "effectful" mean

Time and again I read the term effectful, but I am still unable to give a clear definition of what it means. I assume the correct context is effectful computati

Haskell Monoid Instance Question for a newtype

I am trying to define an instance: newtype Join a = Join { getJoin :: a -> Bool } deriving Generic instance Monoid (Join a) where f <> g = ???

Understanding the Reader monad

I'm reading PureScript by Example and got to the part introducing the Reader monad. The example goes like this: createUser :: Reader Permissions (Maybe User) c

New state of the art in unlimited generation of Hamming sequence

(this is exciting!) I know, the subject matter is well known. The state of the art (in Haskell as well as other languages) for efficient generation of unbounded

Is implementing the words function possible without a postprocessing step after folding?

Real World Haskell, chapter 4, page 98 of the print asks if words can be implemented using folds, and this is my question too: Is it possible? If not, why? If i

Haskell ncurses

main :: IO() main = runCurses $ do setEcho False w <- defaultWindow canvas <- newWindow 19 19 0 0 panel <- newPanel canvas updateWindow canv

Reverse a list in haskell

I am trying to reverse a list. Following is my code: reverseList :: [Int] -> [Int] reverseList [] = [] reverseList (x:xs) = x:reverseList xs What ends u

Lazy Catalan Numbers in Haskell

How might I go about efficiently generating an infinite list of Catalan numbers? What I have now works reasonably quickly, but it seems to me that there should

Neural Network Always Produces Same/Similar Outputs for Any Input [closed]

I have a problem where I am trying to create a neural network for Tic-Tac-Toe. However, for some reason, training the neural network causes it

Implementing a language interpreter in Haskell

I want to implement an imperative language interpreter in Haskell (for educational purposes). But it's difficult for me to create right architecture for my inte