Haskell

jaror, in Haskell Interlude 30: Bartosz Milewski
jaror avatar

I love the connection between Haskell and C++ template metaprogramming.

jaror,
jaror avatar

Maybe we should try to market Haskell more to C++ programmers.

ernest, in Haskell Interlude 30: Bartosz Milewski
ernest avatar

BartoszMilewski Mastodon account

jaror, in [ANN] GHCup-0.1.19.5 release candidate (GHCJS cross support)
jaror avatar

I thought running GHC JS output required nodejs. Does GHCup also manage that or is that an implicit requirement?

maerwald, (edited )

HelloJS is a wrapper that calls nodejs. Also see https://gitlab.haskell.org/ghc/ghc/-/wikis/javascript-backend/building#compiling-hello-world

GHCup doesn't manage system dependencies.

someacnt, in Monthly Ask Anything (July 2023)

Hello. I still cannot see this magazine from lemmy (specifically, sopuli.xyz). Does anyone know why? Is there a way I could fix this? Thank you!

jaror,
jaror avatar

Strange. It does see https://sopuli.xyz/c/kbinMeta@kbin.social, but not https://sopuli.xyz/c/haskell@kbin.social

Maybe you can try reaching out to the admins as that error page suggests.

jaror,
jaror avatar
someacnt,

I see, I will report soon. Could not find time to do so now, sadly

demesisx,
@demesisx@infosec.pub avatar

Sounds like that instance isn’t federated with kbin.social. I can see it just fine over here in infosec.pub

ptitfred, in Amazonka 2.0.0-rc2 released

That’s good news! I hope the gogol library would enjoy a release soon after. It’s getting hard to maintain projects depending on those right now.

jaror, (edited ) in How Megaparsec combines error information
jaror avatar

To understand the behavior of megaparsec's <|> operator it is useful to know about "consuming" and "non-consuming" (or "empty") parses. To illustrate that concept I'll compare a literal string parser to a parser that parses each character separately, watch:

> let p = string "abc"
> let q = sequence [char 'a', char 'b', char 'c']
> parseMaybe (p <|> string "abd") "abd")
Just "abd"
> parseMaybe (q <|> string "abd") "abd"
Nothing

So, what happened? Well, when string "abc" tries to parse the string "abd" it fails without consuming any input. Or you can think of it as backtracking back to the beginning of the string. In contrast, the parser sequence [char 'a', char 'b', char 'c'] does consume the 'a' and 'b' characters even if it fails. In this case, <|> will not even try to use the string "abd" parser.

You can manually force the parser to backtrack by using the try function as follows:

> parseMaybe (try q <|> string "abd") "abd"
Just "abd"

But note that this can cause exponential running time, so try to avoid it.

To answer your question given this information: the error information will be combined but only if both arguments of <|> are failing without consuming any input. If either consumes input, then only the error information from that branch is used.

underlap, in How Megaparsec combines error information

The source code appears to be in Text/Megaparsec/Internal.hs, although I haven't gotten my head around it yet.

underlap, in How Megaparsec combines error information

I tried a simple example and it seems to work the way I expected.

tfcmad, in Monthly Ask Anything (July 2023)

deleted_by_author

  • Loading...
  • jaror, (edited )
    jaror avatar

    I like to use https://www.libhunt.com/l/haskell to explore popular Haskell projects. The three projects with the most stars on GitHub are:

    • ShellCheck, which checks shell scripts for potential problems
    • Pandoc, which converts documents between different formats
    • Postgrest, which serves a REST API from postgres databases

    There's also the State of the Haskell Ecosystem page which rates the level of maturity of different use-cases and programming needs.

    underlap, in Introduce Yourself

    I'm Glyn Normington. I dipped into Haskell briefly in about 2011, but recently got a little deeper into it when I taught a second year functional programming module at Winchester University, UK. I'm a retired programmer with 39 years experience and try to pass on some general tips in the module. I came here after recently deleting my Reddit account. (I've been on the Fediverse for a while as fosstodon.org/@underlap.)

    jaror, in Issue 375 :: Haskell Weekly Newsletter
    jaror avatar

    My favourite this week is the post about Twain: https://gilmi.me/blog/post/2023/07/01/why-i-use-twain. I will probably use Twain if I ever want to write a simple web server in the future.

    jaror, in Bytestring-0.11.5.0 and bytestring-0.12.0.0
    jaror avatar

    Interesting that they consider removing a rewrite rule to be a breaking change.

    jaror, in Hierarchical string diagrams and applications
    jaror avatar

    I know this is not directly related to Haskell and it uses a lot of category theory. But I think at least the introduction is relatively readable and already has some interesting observations, such as the criterions to compare notations:

    A notation is better if it absorbes more equations, by which we mean that instead of using an explicit equation to identify two terms they become syntactically equal in the improved notation.

    A superior notation absorbs more invariants, so that malformed terms cannot be written as such.

    And their ultimate goal:

    The ultimate aim of this tutorial is to persuade the reader to accept a new and multifaceted vision of syntax which we (rather grandly) call syntactic trinitarianism: terms, diagrams, graphs.

    I would love a visualization tool for Haskell that converts terms into diagrams.

    jaror, in [RFC] Bumping recommended GHC to 9.4.5 in GHCup
    jaror avatar

    I was still mainly using 9.2.8 since that is still the default on nixos unstable. But I think 9.4.5 seems stable enough to recommend.

    kleidukos, in Monthly Ask Anything (July 2023)

    Why must FinalizerPtr take a foreign function that uses the ccall calling convention? Is there a concrete thing preventing GHC from accepting capi?

    glguy,

    I suspect that comment predates the existence of capi and is trying to avoid having some other actual calling convention like stdcall because the function pointer is actually invoked from some C code in the RTS. capi is a sort of pseudo-calling-convention in that it generates some C code and then calls that stub.

    Have you tried using a capi defined funptr there to see what happens?

    kleidukos,

    Thank you, that's indeed a reasonable suspicion. I haven't tried because this is for a PR that's been submitted to me and I actually have no idea how this could blow up in my face later (or even worse, not blow up an silently corrupt stuff)

    kleidukos,

    I have my answer: cAPI is fine: https://gitlab.haskell.org/ghc/ghc/-/issues/23599

  • All
  • Subscribed
  • Moderated
  • Favorites
  • haskell
  • DreamBathrooms
  • InstantRegret
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • rosin
  • everett
  • Durango
  • Youngstown
  • slotface
  • cubers
  • kavyap
  • ngwrru68w68
  • ethstaker
  • JUstTest
  • mdbf
  • Leos
  • GTA5RPClips
  • osvaldo12
  • tester
  • modclub
  • khanakhh
  • cisconetworking
  • provamag3
  • anitta
  • normalnudes
  • megavids
  • lostlight
  • All magazines