#BabelOfCode 2024
Week 7
Language: Haskell
Confidence level: Medium low
PREV WEEK: mastodon.social/@mcc/114308850…
NEXT WEEK: mastodon.social/@mcc/114463342…
RULES: mastodon.social/@mcc/113676228…
I was going to do Fennel this week, but then I looked at the problem and thought "this is ideal for Haskell "amb". I have been looking for an excuse to use Haskell "amb" for 25 years. So Haskell.
I have tried to learn Haskell 3 times now and failed. This "Babel of Code" thing was originally in part an excuse to do Haskell
Questa voce è stata modificata (5 mesi fa)
mcc
in reply to mcc • • •I am not sure whether the reason I previously failed Haskell is
1. Because it's actually hard
2. Because of a mental block caused by failing at it more than once already
3. Because Haskell users are really bad at explaining things
I think it's a little 2 and mostly 3. I *love* ML, I know two MLs (3 if you count Rust) plus have in the past written my own ML. I understand the parts of Haskell that are just ML and get lost whenever I hit "do"— the point of divergence from ML; the dreaded Monad.
mcc
in reply to mcc • • •mcc
in reply to mcc • • •In the Haskell docs
wiki.haskell.org/Haskell_in_5_…
It states this is how you build a Haskell program to run it.
Assuming I realize I can drop -threaded, is actually the easiest/correct way to build a Haskell program to run in the year 2025?
Haskell in 5 steps - HaskellWiki
wiki.haskell.orgmcc
in reply to mcc • • •I run the given ghc --make command. It leaves some crap in src/. Say I do not want intermediate files in my source tree. I would like them to be moved to bin/ or obj/ or something, or simply not retained. Is this possible, or is Haskell in 2025 simply a "leaves crap in src/" kind of language in 2025?
I found -no-keep-hi-files and -no-keep-o-files (despite them technically not being documented) but say I want to retain them, just in a place of my choosing.
ase
in reply to mcc • • •ase
in reply to ase • • •mcc
in reply to ase • • •@annanannanse Wait, what? I can use cabal for normal builds?
Are these the directions to use ?
cabal.readthedocs.io/en/stable…
3.1. Quickstart — Cabal 3.14.2.0 User's Guide
cabal.readthedocs.ioase
in reply to mcc • • •رہگزر
in reply to mcc • • •@annanannanse You need a cabal project to be able to use `cabal build` or `cabal run`. There is `cabal init` to produce a skeleton. Not so simple unfortunately.
I think for simple tasks it is better to run stuff from ghci and just forego compiling entirely.
Stags
in reply to mcc • • •While researching this online, I found a build tool called cabal.
cabal build --builddir=dist/build-artifacts
Marcel(le)
in reply to mcc • • •mcc
in reply to mcc • • •Oblomov reshared this.
Owen Nelson
in reply to mcc • • •mcc
in reply to Owen Nelson • • •Owen Nelson
in reply to mcc • • •rk: it’s hyphen-minus actually
in reply to mcc • • •Glyph
in reply to mcc • • •reshared this
mcc e Oblomov reshared this.
mcc
in reply to mcc • • •Aaron Sawdey, Ph.D.
in reply to mcc • • •Marcel(le)
in reply to mcc • • •Debian stable is at GHC 9.0.2, Debian unstable at GHC 9.6.6 and upstream GHC is maintained at versions 9.6 up to 9.12. I have seen some good work from Cabal devs, but feature sets may be more practical to have packages available over a broad range of versions. I totally agree and would want new packages to take up the new features, though!
mcc
in reply to Marcel(le) • • •Marcel(le)
in reply to mcc • • •mcc
in reply to mcc • • •I am attempting to call "openFile" on the first command line argument in Haskell¹. It doesn't like it.
I'm not sure I'm looking at the right docs. I searched Google for "haskell system.io" and got hackage.haskell.org/package/ba… . I don't know if this is the newest Haskell2010 or if $GOOG is confused.
The doc (every doc I find) claims the type of openFile is FilePath -> IOMode -> IO Handle. But hls on my computer seems to think it's FilePath ->IOMode -> Bool -> IO Handle. Am I missing something?
System.IO
hackage.haskell.orgbars
in reply to mcc • • •mcc
in reply to bars • • •bars
in reply to mcc • • •mcc
in reply to mcc • • •samir, in another castle
in reply to mcc • • •I am excited you’re writing Haskell. 😄
In general, it’s unlikely you want to be importing `GHC`. If ever you do need to, you’ll know.
Shae Erisson
in reply to mcc • • •I got paid to write Haskell for five years, could maybe speed up your getting started process?
mcc
in reply to Shae Erisson • • •mcc
in reply to mcc • • •Haskell people, please help me.
There are 3 image attachments to this post, showing the same code block but with different amounts of indentation.
The first code block works,
the second block does not work,
the third one REALLY does not work.
According to my editor, none of these blocks of code contains tabs.
Haskell appears (?) to treat three spaces, four spaces, and eight spaces radically differently.
I dislike multiple-of-3 indents.
What do I need to read to understand what I am missing?
Keith Wansbrough
in reply to mcc • • •mcc
in reply to Keith Wansbrough • • •bars
in reply to mcc • • •only in the first case is the "let" keyword (and following code) aligned to "do"
It's just significant whitespace. You can either align everything on the column after "do " (that's where the 3 chars come from) or indent on a newline with an indent width of your choice.
jleedev
in reply to mcc • • •10 Syntax Reference
www.haskell.orgmcc
in reply to mcc • • •Another cursed question.
See attachment 1. This code compiles.
Reading the documentation ( hackage.haskell.org/package/me… ), I realize I do not want space but "space1" (see attachment 2).
I change the symbol "L.space" to "L.space1". No!! Says GHC. L does *not* export space1!! only space!!
But the documentation says it exports space1?
Text.Megaparsec.Char
hackage.haskell.orgmcc
in reply to mcc • • •My problem can be explained if when I put dependency "megaparsec ^>=9.7.0" in my cabal file it picked like version 5 or 6 or something.
Is there a way to get cabal to print out for me what version it actually chose of each solved dependency? In npm or Rust for example I would consult the lock file.
mcc
in reply to mcc • • •I never solved the space1 problem but worked around it with a solution from @dysfun . I now have three new questions.
1. In attachment 1, why is "return" not required on L.decimal? I originally wrote "return" and it gave me a hint saying I could remove it, and removing it works. But return *is* required on (lsum, nums)?
2. In attachment 2: If att. 1 is allowed, why is this not allowed? It gives "parse error (possibly incorrect indentation or mismatched brackets)" on the _. Wrong type syntax?
mcc
in reply to mcc • • •mcc
in reply to mcc • • •crzwdjk ✅
in reply to mcc • • •mcc
in reply to mcc • • •One more question (I think this question might be outright goofy).
Is there a specific syntax for "calling a monad of a different type" from the current monad?
I have constructed a megaparsec-monad combinator that parses my pattern. I've made an IO-monad function that reads lines one at a time. If I call the megaparsec combinator I made inside my IO monad, I get a confusing error.
The megaparsec tutorial implies a combinator can act like a function that takes strings: markkarpov.com/tutorial/megapa…
Megaparsec tutorial
markkarpov.comjleedev
in reply to mcc • • •mcc
in reply to mcc • • •J3RN
in reply to mcc • • •reshared this
mcc e Oblomov reshared this.
mcc
in reply to mcc • • •So the answer to my last question was to use "parse"/"runParser" (aliases for 1 function) from megaparsec. Great.
It's not working and I think the problem is I don't understand destructuring. I want the equivalent of Rust
let Some(x) = f() else { panic!("Not found!"); }
I *think* I'm getting an Either, and I need to match its cases. But the way I know how to do that is "case…of". And the arrows in that "point the wrong way"?? Compare this similar attempt to unpack a list into its 1 item:
Zoe : Void -> a
in reply to mcc • • •Zoe : Void -> a
in reply to Zoe : Void -> a • • •"[x] -> [x]"
mcc
in reply to Zoe : Void -> a • • •Zoe : Void -> a
in reply to mcc • • •mcc
in reply to mcc • • •Alright. Thanks for the explanations y'all. I am now correctly parsing my input file. Current source:
github.com/mcclure/aoc2024/blo…
I STILL can't figure out how to make the match on line 43 give a more human-readable error (on the array destructure on the command line argument processing) than "user error (Pattern match failure in 'do' block at app/Puzzle.hs:43:5-12)", but since I'm the only one running this I guess this only matters for "this hurts my sense of professionalism!!" reasons.
aoc2024/07-01-operations/app/Puzzle.hs at d23ee9139e6645022504fce2dc26f39601e66933 · mcclure/aoc2024
GitHubmcc
in reply to mcc • • •I will say. I could have done *this entire 50 line Haskell program* in the following two lines of perl:
perl -e 'open(FH,"$ARGV[0]"); while (<FH>) { /^(\d+):\s+(\d+(?:\s+\d+)*)$/ or die "Invalid input"; my $sum=$1; my @ops = split(/\s+/, $2); }'
…and I suspect writing that not only required far, far less thought for me, but would have required far less thought for someone who was already versed in both Haskell and Megaparsec.
(EDIT: Note to run this snippet you must remove the 0-width space.)
reshared this
ʙwɑnɑ нoɴoʟʊʟʊ, Oblomov e Lord Caramac the Clueless, KSC reshared this.
Norgg
in reply to mcc • • •reshared this
mcc, ʙwɑnɑ нoɴoʟʊʟʊ e Lord Caramac the Clueless, KSC reshared this.
mcc
in reply to Norgg • • •Onairda, el Oripmav
in reply to mcc • • •die unless [extremely trivial computery thing];
mcc
in reply to Onairda, el Oripmav • • •@adriano @Norgg
fix(YOUR, $hearts) or die;
mcc reshared this.
Onairda, el Oripmav
in reply to mcc • • •FoolishOwl
in reply to mcc • • •Zoe : Void -> a
in reply to mcc • • •print . sum . fmap (read @int) . words =<< readFile . head =<< getArgs
mcc
in reply to Zoe : Void -> a • • •@zmz @int No; it is splitting a file into lines, then for each line matching the pattern
num: num [num num…]
and returning the tuple (initial_number, [list_of_following_numbers])
So that is a little more complicated.
I also intentionally did it such that it interprets each line one by line instead of buffering the entire file (the perl oneliner solution does this) which might complicate things.
Zoe : Void -> a
in reply to mcc • • •Alex Waters
in reply to mcc • • •@zmz my fortunate or unfortunate choice of username has somehow landed me in a Haskell community discussion on regular expressions.
Wrong number. Figures.
arclight
in reply to mcc • • •mcc
in reply to arclight • • •mcc
in reply to mcc • • •mirek kratochvil
in reply to mcc • • •mcc
in reply to mcc • • •Haskell syntax question: Is there a thing I can do to convince GHC that when I said "-1" I REALLY, definitely wanted the unary integer negation operator and not something else, so I don't get a spurious warning
(No one agrees with me but I still think SML was right to use ~ for integer negation.)
EDIT: Seems the problem isn't unary - at all but that Haskell feels unsure this is int and not some other Num. -(1 :: Int) solved it.
Amélia Liao
in reply to mcc • • •(- 1)ornegate 1mcc
in reply to Amélia Liao • • •Amélia Liao
in reply to mcc • • •times :: Int <- amb [-1, 1]or[-1 :: Int, 1](or[-1, 1 :: Int]etc)mcc
in reply to Amélia Liao • • •mcc
in reply to mcc • • •I've reached the part of the puzzle that inspired me to write this in Haskell to start with: The "amb" combinator. I read about this decades ago and it captivated me as the one example I'd seen of what made Haskell's weirdo pure-functional model "useful".
Here's my outsider's awareness of what a monad is:
You write some code, and it's executed in a sequence.
*What does that mean*?
The monad defines what *sequentiality* means. For example "IO" means "linearly in time, as external events allow"
mcc
in reply to mcc • • •(Okay functional fans, THIS is the point where you can reply to object I'm describing monads wrong.)
I think this is why the Haskell folks latch onto category theory. As best I understand, category theory is about explaining what it means to "apply" a thing to another thing:
web.archive.org/web/2025010716…
I think I understand why the correspondence from the category functor to the Haskell functor typeclass is exact, so I'm willing to believe Haskell Monads mostly correspond to…something categorical.
This video is the only thing I've ever seen that made "categories" make sense to me
andi on cohostmcc
in reply to mcc • • •Anyway, the Amb monad, as offered by the "nondeterminism" package¹:
hackage.haskell.org/package/no…
Stretches this definition by defining "sequential code" thus: *It is nonsequential*. The Amb monad can fork computations, and answer questions like "do all paths return?" "does ANY path return?" "give me a list of all possible results".
¹ For some reason until today I thought it was a language builtin. It's not; it's just something multiple people have implemented in various ways in the last 30 years.
nondeterminism
Hackagemcc
in reply to mcc • • •So here's a test program with Amb. You can probably read it without knowing Haskell! "aMemberOf" in sumTen forks the computation by running the code following it with *both* members of the list -1, 1.
We de-monadify this, making it a real single computation, with the nondeterminism package's "isPossible", which returns true if any path does. Does *either* 6 + 4, *or* 6 - 4, sum to ten? 6 + 4 does, so this code prints true. Wow! That was shockingly easy!
mcc
in reply to mcc • • •Then I try to make it *marginally* more complex and I run facefirst into the wall that is Haskell's baroque syntax.
It took me like… 15 minutes to figure out how to modify the type signature of sumTen to take 1 argument. I kept expecting it to be Amb Bool Bool Int but no it's Int -> (Amb Bool Bool). I *think* I now understand why it's the way it is, and I *think?* I also understand why TakeLines upthread returned "IO Int" and not "Int -> IO", but I'm not sure how I was supposed to have known it
mcc
in reply to mcc • • •cλémentd
in reply to mcc • • •cλémentd
in reply to cλémentd • • •cλémentd
in reply to cλémentd • • •mcc
in reply to cλémentd • • •mcc
in reply to mcc • • •@clementd I've been trying since last night to figure out how to put a second case on this destructure (something like Rust "let [x] = an_array else { panic!("Incorrect array length"); }
github.com/mcclure/aoc2024/blo…
aoc2024/07-01-operations/app/Puzzle.hs at d23ee9139e6645022504fce2dc26f39601e66933 · mcclure/aoc2024
GitHubcλémentd
in reply to mcc • • •cλémentd
in reply to cλémentd • • •mcc
in reply to cλémentd • • •mcc
in reply to mcc • • •cλémentd
in reply to mcc • • •mcc
in reply to cλémentd • • •cλémentd
in reply to mcc • • •cλémentd
in reply to cλémentd • • •mcc
in reply to cλémentd • • •cλémentd
in reply to mcc • • •cλémentd
in reply to mcc • • •mcc
in reply to cλémentd • • •cλémentd
in reply to mcc • • •mcc
in reply to mcc • • •If I am compiling a Haskell 2010 program in GHC 9.6.7 on an AMD64 machine, and I multiply two Int numbers to produce a third Int (Int NOT Integer), and the answer would be larger than a 64 bit integer can hold,
What happens?
Silent overflow?
A thrown exception?
Amélia Liao
in reply to mcc • • •mcc
in reply to Amélia Liao • • •Marcel(le)
in reply to mcc • • •Ingvar
in reply to mcc • • •mcc
in reply to mcc • • •Come use Haskell: Once you can get it to work at all, time travel is free! But good luck getting it to work at all
Working code:
github.com/mcclure/aoc2024/blo…
Things of note:
- Running a time-traveling computation across many parallel universes took 11 lines of code. Splitting a string on colons and then again on spaces took 30
- Keeping with the "hard things are easy, easy things are hard" rule, I switched this code from 64-bit to arbitrary-precision ints by find-replacing "Int" with "Integer".
aoc2024/07-01-operations/app/Puzzle.hs at 3346faa24e81d3b74646067548debb9096695ef6 · mcclure/aoc2024
GitHubmcc
in reply to mcc • • •mcc
in reply to mcc • • •Say I want to count the decimal digits in a Haskell Integer (ie, the bignum type). With a regular int I'd cast to double then do ceil(log10(i)), but the number might be poorly representable as double.
I try to look around the Haskell standard library. I get lost. I scroll:
hackage.haskell.org/package/ba…
I find a hackage.haskell.org/package/ba… which looks like it offers a pure-integer arbitrary log base, but it says it's "for back compat" and returns "int#" (?)
Where's the REAL list of integral operations?
base
Hackagemcc
in reply to mcc • • •mcc
in reply to mcc • • •Part 2, which is usually supposed to be a gotcha¹, took about 6 lines of code.
github.com/mcclure/aoc2024/blo…
The only hard part was navigating the Haskell documentation. Which was *very hard* because GHC publishes both an integer-gmp and a ghc-bignum package (which uses gmp) and you have to figure out which one is fake
¹ I suspect, but haven't tested, the true "gotcha" here is that The AOC Writer assumes you're using 64-bit ints, but the part 2 conditions require use of bignums for correct answers.
aoc2024/07-02-operations/app/Puzzle.hs at a694551565afa1bb92bdaf9615af3ddf19404ccf · mcclure/aoc2024
GitHubmcc
in reply to mcc • • •To wrap up: Using Haskell was a powerful argument in favor of *a Haskell-like language* (the monadic style) and I kinda never want to write Haskell again. I found the documentation for both the base language and every library impenetrable; the tools to be clearly powerful at core but full of jagged edges in practice; the syntax got in my way more than it helped; and the ubiquitous <*- type operators constantly inhibited understanding.
But I think I'll try Idris and Purescript later this summer.
Hugo "Dark Satanic" Mills
in reply to mcc • • •mcc
in reply to mcc • • •I, in the aspect of Eris, shall now throw a golden ball of discord into the garden of Mastodon functional programmers.
1. If I'm auditioning pure functional languages, should I try PureScript or Elm? Why?
2. What's the difference between `<<` and `<*`?
Amélia Liao
in reply to mcc • • •mcc
in reply to Amélia Liao • • •Amélia Liao
in reply to mcc • • •<*and it results in more general code but it used to be the case that<<and<*were incomparably generaliamevn
in reply to mcc • • •this is coming from someone who has only read a lot of the PureScript docs but has prototyped a couple things in Elm so I'm by no means authoritative
Elm is worth checking out but I think using it for the first time in this context will just lead to pain. it really shines when building interactive things imo and is annoying to do crunchier algorithms in
mcc
in reply to iamevn • • •mcc
in reply to mcc • • •rook
in reply to mcc • • •Jona Joachim
in reply to mcc • • •nitrofurano
in reply to mcc • • •William D. Jones
in reply to mcc • • •Marcel(le)
in reply to mcc • • •mcc
in reply to Marcel(le) • • •Marcel(le)
in reply to mcc • • •Chris Ford
in reply to mcc • • •mcc reshared this.
mcc
in reply to Chris Ford • • •mcc reshared this.
Chris Ford
in reply to mcc • • •rk: it’s hyphen-minus actually
in reply to mcc • • •@cford
I’ve also seen it referred to as the “angelic operator”, as an angel will swoop in to make sure the right choice was made even retroactively.
I’ve often wondered — and please understand that I know fuckall about physics really — if quantum coherence works something like amb behind the scenes.
#physics
Cassandra is only carbon now
in reply to mcc • • •The way I normally think of monads is as something that wraps a value in some way, but where you can still operate on that wrapped thing using functions that don't know about monads.
E.g.: async is a monad, but you can still do normal stuff to an async future by awaiting fist. Or list is a monad, but you can still do normal stuff to a list by mapping scalar functions over the list.
mcc reshared this.
Cassandra is only carbon now
in reply to Cassandra is only carbon now • • •Dan Piponi
in reply to mcc • • •It is correct that category theory is about composing functions and this means it works well when you want to reason about composing functions.
But there's also the part of category theory that's about what you *can't* do. For example consider a Haskell function f with signature:
f :: [t] ->
[t]It's a polymorphic function mapping lists to lists. It has to work for t of any type and that means the function *can't* examine the elements in the list. All f can do is rearrange and copy from its argument, and do the same rearrangement whatever types are in the list. This means we can immediately say a lot about f without looking at the code.
This corresponds very well to the notion of a natural transformation in category theory. The definition of a monad involves two natural transformations.
This ability to talk about what you *can't* do maps well to the idea of an interface that hides implementation details from you. I think that's an important reason why category theory is useful here.
∃ugene -Yokota 🥙
in reply to mcc • • •my intuition of the monad is that they describe fractals, i.e. any data structure that can reasonable nest itself inside it along with some data, like List of List of List
and this nestedness is useful because it gives us fearless composition. like if we have two parsers `p1` and `p2`, you can nest them in `Parser(p1, p2).join`, like the turtle of the turtle all the way down. `IO` I think is a mini-program-as-data.
eed3si9n.com/monads-are-fracta…
monads are fractals · eed3si9n
eed3si9n.comnex
in reply to mcc • • •I feel like it's more interesting to study what an individual thingy that happens to be a monad does, on a case-by-case basis, than caring about what the super-abstract concept of a monad *is* in general.
Some monads are hacks that let you express something procedural/sequential in a purely functional language. OK, cool, that's useful!
But are monads somehow fundamentally about *sequentiality*? I dunno and I'm reluctant to look into it, because I have doubts about this being interesting.
Mark T. Tomczak
in reply to mcc • • •Realtalk: this one-letter-variable-name thing is one of the things that pushed me out of academia.
Read some professor's code. Realized not only was this fine, this was considered standard.
Decided I did not want to deal with this for the next forty years.
mcc reshared this.
curtmack
in reply to mcc • • •In both Haskell and ML, it can help to declare types even when it's not required. Doing so acts as a static assertion that the value is indeed that type.
I try to do this for all top-level declarations, at a minimum. This really helps narrow down where the error actually happens.
J3RN
in reply to mcc • • •WombatRat 🐀
in reply to mcc • • •dagelf
in reply to mcc • • •I'm not a Haskell person, but did you know that an MCC is the South African name for Champagne? 🥂😜
I would think the recommended version would be older because the latest is still in testing... can you think of a better way to release (and publicize, and test) new features?
Anyways love how you're posting about this, I probably wouldn't get any responses if I did, but in going to do it anyway when I learn something new.
voyd
in reply to mcc • • •mcc
in reply to voyd • • •voyd
in reply to mcc • • •Aliaksei Chareshneu
in reply to mcc • • •mcc
in reply to Aliaksei Chareshneu • • •J3RN
in reply to mcc • • •Anupam 🇮🇳《ミ》λ≡
in reply to mcc • • •mcc
in reply to Anupam 🇮🇳《ミ》λ≡ • • •abadidea
in reply to mcc • • •GD2
in reply to abadidea • • •mcc
in reply to GD2 • • •Lucas Treffenstädt
in reply to mcc • • •cλémentd
in reply to mcc • • •mcc
in reply to cλémentd • • •cλémentd
in reply to mcc • • •Scott Cheloha
in reply to mcc • • •every time I start reading about category theory I get a paragraph deep and my eyes glaze over and I can't. keep. going.
is there a baseline proficiency one can get to with Haskell (or another functional language?) where the category theory stops making your eyes glaze and you experience a spark of recognition?
or do you have to buckle down and do the reading first in order to "get it"
mcc
in reply to Scott Cheloha • • •@scottcheloha I do not know category theory and I am not having problems with Haskell. I think the thing that would help more to learn is "point free programming". Or just say fuck Haskell and go learn an ML (like Rust…)
Incidentally, this is the video that made category theory make sense to me in a way other things before had not. web.archive.org/web/2025010716… I still don't know what it's good for.
This video is the only thing I've ever seen that made "categories" make sense to me
andi on cohostλTotoro
in reply to mcc • • •mcc
in reply to λTotoro • • •λTotoro
in reply to mcc • • •J3RN
in reply to mcc • • •To run your program, you can just do
```
runhaskell A.hs
```
If you want the binary, you can do
```
ghc A.hs
```
Which should create a binary A;
```
./A
```
Anupam 🇮🇳《ミ》λ≡
in reply to mcc • • •mcc
in reply to Anupam 🇮🇳《ミ》λ≡ • • •Leonard Ritter
in reply to mcc • • •the overcautious approach this language has towards causally chained operations with side effects is what put me off.
from my own compiler building i know that it is *so easy* on the implementation side to first chain ops based on an implicit time order, then later remove all obvious dependencies that don't actually matter (which is easy to prove), which leaves only the monadic dependencies. all optimizing imperative compilers implement this informally in some way.
aeva
in reply to mcc • • •Oblomov reshared this.
aeva
in reply to aeva • • •mcc
in reply to aeva • • •Urja
in reply to mcc • • •I'm kinda curious as to trying out Rust some day, but there's a bunch of reasons that have kept me away... one of them is the community (and also the desire to rewrite everything).
Others are things that have come from needing to build packages that use rust -like the compiler being so heavy on RAM (and slow) and it being a hassle to make cargo not use the internet during build time (to the point that I gave up on doing that... it is possible, but yeah.)
And also somehow being unable to do proper dynamic linking kinda bothers me...
Oops, didnt really mean to rant, just to say that yes I also have difficulties.
mcc
in reply to Urja • • •@urja The fact that the build tools are so vague about whether they will/won't work in offline mode, and what they *do* if they are allowed to run in online mode, is indeed a frustration.
I find the lack of dynamic linking more forgivable solely because frankly, it's never worked properly for me in C/C++, so I'm not sure I'm giving up something I actually had.
Steve Holden
in reply to mcc • • •mcc
in reply to Steve Holden • • •Steve Holden
in reply to mcc • • •Ian Badcoe
in reply to mcc • • •I love monads (I don't) and the thing I love about them is I believe it is part of the definition, that they cannot be defined in any way that can be understood...
I've seen c++ takes on them, and those are really easy to understand, which I believe means they are, by definition, not monads.
J3RN
in reply to mcc • • •mcc
Unknown parent • • •mcc
Unknown parent • • •mcc
Unknown parent • • •mcc
Unknown parent • • •mcc
Unknown parent • • •mcc
Unknown parent • • •@dysfun This did something I do not understand.
gist.github.com/mcclure/a189ef…
gist:a189ef177437f8de04a4bf674fa42747
Gistmcc
Unknown parent • • •samir, in another castle
in reply to mcc • • •mcc reshared this.
mcc
Unknown parent • • •mcc
in reply to mcc • • •mcc
Unknown parent • • •mcc
in reply to samir, in another castle • • •mcc
Unknown parent • • •mcc
Unknown parent • • •samir, in another castle
in reply to samir, in another castle • • •mcc
Unknown parent • • •mcc
Unknown parent • • •gaytabase
Unknown parent • • •as for the other thing, i'm a bit out of haskell these days, but maybe it works if you remove the _ <- from the left?
if there is no value to bind, you do not need the left arrow. i hypothesise it's upset that you used anyway for some reason
mcc
Unknown parent • • •samir, in another castle
in reply to mcc • • •@dysfun I *think* so but I feel like there’s some caveats that I’m forgetting. Sorry. If they come to me, I’ll let you know.
Yes, I recommend committing it unless you’re building some kind of general-purpose library.
mcc
Unknown parent • • •mcc
Unknown parent • • •mcc
Unknown parent • • •mcc
Unknown parent • • •mcc
Unknown parent • • •@amy @dysfun Hm.
This is sincerely interesting to me, but also, given that the Megaparsec solution was 30 lines and this is 20 lines, I'm not sure this is a win.
Amélia Liao
Unknown parent • • •lineswords) and some syntax I can't live without gist.github.com/plt-amy/a20616…test.hs
Gistmcc
Unknown parent • • •@saikou Thanks.
I find a "GHC-bignum" and a "integer-gmp" hackage.haskell.org/package/in… is the latter just an older version of the same thing?
GHC.Integer.Logarithms
hackage.haskell.orgmcc
Unknown parent • • •:doll_smile:
in reply to mcc • • •integer-gmp
Hackagemcc
Unknown parent • • •mcc reshared this.
mcc
in reply to mcc • • •Hugo "Dark Satanic" Mills
in reply to mcc • • •mcc
Unknown parent • • •gaytabase
in reply to Hugo "Dark Satanic" Mills • • •mcc
Unknown parent • • •Jona Joachim
Unknown parent • • •If you're interested in purescript and erlang, you might be interested in the gleam programming language
@mcc @darkling
Hugo "Dark Satanic" Mills
in reply to mcc • • •@dysfun Me too. Although running erlang in the browser would be better. 😀
BEAM on WASM?