haskell

Haskell stack installs package, but module can't be imported

北慕城南 提交于 2021-01-07 02:42:06
问题 I seem to be able to install a package using stack, but then it's not available in ghci. I didn't set up a project directory; I'm just loading files from the directory I start ghci in. (I'll get to packages, this is for my early learning experiments.) With stack Version 2.5.1, Git revision d6ab861544918185236cf826cb2028abb266d6d5 x86_64 hpack-0.33.0, I am able to install package pretty-tree : ~$ stack install pretty-tree split > using precompiled package boxes > using precompiled package

Haskell stack installs package, but module can't be imported

一曲冷凌霜 提交于 2021-01-07 02:41:14
问题 I seem to be able to install a package using stack, but then it's not available in ghci. I didn't set up a project directory; I'm just loading files from the directory I start ghci in. (I'll get to packages, this is for my early learning experiments.) With stack Version 2.5.1, Git revision d6ab861544918185236cf826cb2028abb266d6d5 x86_64 hpack-0.33.0, I am able to install package pretty-tree : ~$ stack install pretty-tree split > using precompiled package boxes > using precompiled package

Haskell adding a polymorphic type

ぃ、小莉子 提交于 2021-01-07 01:42:50
问题 I am trying to add a polymorphic == to a data type. I have added the POLYEQ Var Var to data Exp and added Eval1 and Eval2: {-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} data Exp = V Var | B Bool | L Exp | A Exp Exp | MyInt Int | And Exp Exp | Or Exp Exp | Not Exp | Mult Exp Exp | UnaryNeg Exp | LEQ Exp Exp | LESST Exp Exp | Add Exp Exp | POLYEQ Var Var data Var = VZ |VS Var eval:: Exp -> Int eval (MyInt e4) = e4 eval (UnaryNeg e10) = - (eval e10) eval (Mult e11 e12) = eval e11 *

Haskell adding a polymorphic type

我的未来我决定 提交于 2021-01-07 01:42:34
问题 I am trying to add a polymorphic == to a data type. I have added the POLYEQ Var Var to data Exp and added Eval1 and Eval2: {-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} data Exp = V Var | B Bool | L Exp | A Exp Exp | MyInt Int | And Exp Exp | Or Exp Exp | Not Exp | Mult Exp Exp | UnaryNeg Exp | LEQ Exp Exp | LESST Exp Exp | Add Exp Exp | POLYEQ Var Var data Var = VZ |VS Var eval:: Exp -> Int eval (MyInt e4) = e4 eval (UnaryNeg e10) = - (eval e10) eval (Mult e11 e12) = eval e11 *

How do I install the 'Data.List.Split' module for Haskell?

倾然丶 夕夏残阳落幕 提交于 2021-01-06 04:27:40
问题 I have been trying to import the 'Data.List.Split' module since yesterday. I looked around stack overflow for similar questions, but I couldn't find a definitive solution to my slightly basic problem. This is what I wrote in the text editor (excluding comments). import Data.List import Data.Char import System.IO data Cell = Fixed Int | Possible [Int] deriving (Show, Eq) type Grid = [Row] readGrid :: String -> Maybe Grid readGrid s | length s == 81 = traverse (traverse readCell) . Data.List

Why doesn't runConduit send all the data?

二次信任 提交于 2021-01-06 02:47:13
问题 here's some xml i'm parsing: <?xml version="1.0" encoding="utf-8"?> <data> <row ows_Document='Weekly Report 10.21.2020' ows_Category='Weekly Report'/> <row ows_Document='Daily Update 10.20.2020' ows_Category='Daily Update'/> <row ows_Document='Weekly Report 10.14.2020' ows_Category='Weekly Report'/> <row ows_Document='Weekly Report 10.07.2020' ows_Category='Weekly Report'/> <row ows_Document='Spanish: Reporte Semanal 07.10.2020' ows_Category='Weekly Report'/> </data> i've been trying to

Haskell: create a tuple of lists from an input list

久未见 提交于 2021-01-05 04:25:21
问题 I am trying to set up some functions to help with a current project I am working on. I am new to Haskell and struggling to implement my desired functions. I have a list [a] and would like it to output a tuple of four different lists ([b],[b],[b],[b]) where each item in list [a] is successively placed in to the next list in the output tuple. So the first element in the input list [a] goes to the first list [b] , the second element in [a] goes to the second list [b] , the third element in [a]

Haskell: create a tuple of lists from an input list

夙愿已清 提交于 2021-01-05 04:16:38
问题 I am trying to set up some functions to help with a current project I am working on. I am new to Haskell and struggling to implement my desired functions. I have a list [a] and would like it to output a tuple of four different lists ([b],[b],[b],[b]) where each item in list [a] is successively placed in to the next list in the output tuple. So the first element in the input list [a] goes to the first list [b] , the second element in [a] goes to the second list [b] , the third element in [a]

Haskell: create a tuple of lists from an input list

微笑、不失礼 提交于 2021-01-05 04:13:29
问题 I am trying to set up some functions to help with a current project I am working on. I am new to Haskell and struggling to implement my desired functions. I have a list [a] and would like it to output a tuple of four different lists ([b],[b],[b],[b]) where each item in list [a] is successively placed in to the next list in the output tuple. So the first element in the input list [a] goes to the first list [b] , the second element in [a] goes to the second list [b] , the third element in [a]

Why Haskell doesn't have split function? [closed]

人盡茶涼 提交于 2021-01-03 06:58:33
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago . Improve this question In many languages there's a function that breaks strings into parts using specified delimiter. It's often called split . You can find it in Python, C#, Java, JavaScript. But Haskell while being quite mature still lacks such function in the standard