Skip to main content
0 votes
0 answers
28 views

I'm using latest VSCode with Haskell extension. There's a trivial (?) problem of toolchain (GHC, HLS, stack, cabal) being mismatched depending on what process is used to start VSCode (Debian + KDE ...
LetMeSOThat4U's user avatar
0 votes
1 answer
63 views

Code: module Main where main :: IO () main = topLevel topLevel = putStrLn $ "Hello World!" ++ (show 3) Generally on the internet they write that when you want to convert Integer to String ...
LetMeSOThat4U's user avatar
1 vote
0 answers
43 views

Using Haskell's Rel8 library, I am trying to create a typeclass of tables with a primary key, providing a projection of the key in any context. Ideally, it would look something like this: class ...
jedediah's user avatar
  • 1,239
Best practices
1 vote
8 replies
129 views

This isn't a what am I doing wrong? Rather, I'm surprised this works, what's the rationale?/might it all quickly turn to custard. By ‘ambiguous’ we mean that there is a type variable e that appears ...
AntC's user avatar
  • 2,846
3 votes
2 answers
137 views

Since closed type families have all their clauses appearing together and therefore can't be extended with other clauses, and since GHC can detect violations of injectivity annotations anyway (even for ...
Enlico's user avatar
  • 30.8k
Advice
1 vote
16 replies
303 views

We're avid Perl programmers but we have been really wanting to get into Haskell or Erlang or something similar, though we don't know where to start. Any languages you guys recommend? if so, send some ...
tungstengmd's user avatar
1 vote
1 answer
102 views

My question comes for the fact that I don't fully understand the nuances of declaring datatypes. I think I get lost in all the degrees of freedom out there: do I use GADT syntax or not? Do I spell out ...
Enlico's user avatar
  • 30.8k
3 votes
1 answer
110 views

Section §13.2 from Haskell in Depth is about "faking" dependent types in Haskell via singletons. Below is one snippet of code from that section: doorState :: forall s. Door s -> DoorState ...
Enlico's user avatar
  • 30.8k
Best practices
0 votes
18 replies
169 views

Typically typeful programming uses Proxy to signal to the reader this is used for its type, not its value. Indeed there might not be any usable value/it's typically undefined. Here's a previous q ...
AntC's user avatar
  • 2,846
2 votes
1 answer
137 views

I have the following function which splits a list in half: halve :: [a] -> ([a], [a]) halve xs = go xs xs where go (x : xs) (_ : _ : ys) = mapFst (x :) $ go xs ys go xs _ = (...
Wheat Wizard's user avatar
  • 4,268
-2 votes
1 answer
148 views

My wordle solver seems to be slow, i would like to ask your opinions on how i can speed it up further I did some optimizations i could think of, but speed still seems to be bad As far as i understand, ...
kavasak's user avatar
  • 29
4 votes
0 answers
211 views

This "warning sign" character, ⚠️, corresponds to the sequence of codepoints U+26A0 U+FE0F (if I understand correctly, it is ⚠ followed by a variation selector character), so I can render it ...
Enlico's user avatar
  • 30.8k
2 votes
2 answers
146 views

Say I define this datatype in my library data Foo = Foo (String, String, String, String) and that I expose a bunch of things do use it, but that the client really only needs to construct a Foo and ...
Enlico's user avatar
  • 30.8k
Best practices
0 votes
7 replies
95 views

Assuming a length-indexed list/GADT as per this recent Q: {-# LANGUAGE GADTs, DataKinds, KindSignatures #-} data Vec a (n :: Nat) where Nil :: Vec a Zero Cons :: a -> Vec a n -> Vec a (...
AntC's user avatar
  • 2,846
2 votes
1 answer
107 views

I used ghcup to install the Haskell build tool "stack". When setting up ghcup, it gives you an option to configure stack to use ghcup to manage ghc versions, this is handy because it makes ...
Joe's user avatar
  • 1,679

15 30 50 per page
1
2 3 4 5
3456