Gonzalo Nemmi :runbsd: · @gnemmi
142 followers · 1809 posts · Server mastodon.sdf.org

@daftaupe @screwtape and succeeding!!
You guys have been doing an awesome work for the last years, always improving upon your previous work!.
Always pushing to its limits, stressing the kernel/scheduler/fs/etc to new heights!.
I just wish some pkgs didn't hit some heavy ( ), and that maybe some of the bigger projects ( ?) could, someday, lend some support so you could have time to focus in other areas that are lacking 🖒

#dsynth #ghc #rust #firefox #runbsd #dragonflybsd

Last updated 1 year ago

Boyd Stephen Smith Jr. · @BoydStephenSmithJr
67 followers · 1098 posts · Server hachyderm.io

@julesh Haskell as defined by the report doesn't have unsafeCoerce. That's you are thinking of.

You can implement unsafeCoerce via the standard 2010 FFI, but you'd have to implement it in C (or something C ABI compatible).

Agda and Idris both have "believe me" escape hatches from their type system.

I just really don't get the point of discarding soundness though. That's the whole purpose of a type system! Well typed programs don't go wrong *because* the type system is sound.

#ghc

Last updated 1 year ago

Boyd Stephen Smith Jr. · @BoydStephenSmithJr
67 followers · 1098 posts · Server hachyderm.io

@emc2 IIRC actually using a class that way is a bit of an anti-pattern as the (universally overlapping) instance is banned in the Haskell report, so everyone has to write instances or go via a newtype. Plus, the no-function class never gets introduced into type inference / checking, only propagated.

In you would use a constraint synonym or constraint family instead.

#ghc

Last updated 1 year ago

Boyd Stephen Smith Jr. · @BoydStephenSmithJr
66 followers · 1027 posts · Server hachyderm.io

@kosmikus Async exceptions are a mistake and not required by the Report. It's unfortunate the amount of code that would break if removed them.

#haskell #ghc

Last updated 1 year ago

@hongminhee IME, the tooling with is actually worse than the tooling with , which really seemed to be the main problem raised in the article.

I haven't played around with the latest and greatest web backends for GHC, but I did try GHCjs and PureScript at the same time, and felt PureScript was already ahead of the game then. But what other people tend to call "tooling" (I find the concept nebulous) has never seemed to be a priority for me.

#purescript #ghc #haskell

Last updated 1 year ago

@sean I wish I had learned as an undergrad (around '98 just after that report was published). I think it could have been enough of an inspiration to significantly affect the course of my career.

It might also have caused me to be in a better place to help with publishing new Haskell reports. I find it demotivating that Haskell is now effectively implementation-defined (by ).

#haskell #ghc

Last updated 1 year ago

I've done some searching, but I can't find a way to get the REPL (GHCi) to show my the roles inferred for the parameters of a type in scope.

:type and :kind didn't seem to work

Is this something I have to use a different tool for, or just do the inference myself?

#ghc #haskell

Last updated 1 year ago

HoldMyType · @xameer
233 followers · 6432 posts · Server mathstodon.xyz

can infer where to apply the MapMotive function if the definition of the step is inlined, leading to a more compact definition.
constraints GHC reconstructs to be able to verify why this works for ourselves. The first problem we had was that the base case passed in had a different type than the result (Vec 0 a ~ Vec n a).

p @@ 0 ~ (MapMotive d) @@ 0 ~ Vec 0 d
p @@ n ~ (MapMotive d) @@ n ~ Vec n d

This problem does not occur for vmap because we no longer need to unify the base and end case; they are distinct types in the dependent fold. What about the second problem, where the step function changes the type? For that conundrum,

p @@ l ~ (MapMotive d) @@ l ~ Vec l d
p @@ (l + 1) ~ (MapMotive d) @@ (l + 1) ~ Vec (l + 1) d
SNat l -> a -> p @@ l -> p @@ (l + 1) ~ SNat l -> c -> Vec l d -> Vec (l + 1) d (from unifying the step function for dfoldr and the step function defined in vmap)

we can see that the last constraint is consistent between the definition of dfoldr and the definition of vmap.
dependently typed folds subsume the standard folds9, it would be possible to replace all folds with their dependent counterpart
while we can likely automatically derive the definition of the standard fold from the dependent fold, the developer implementing an instance of the Foldable typeclass would now need to use dependent types, which may be a rough barrier especially if the developer has no intention for the fold to be used in a dependent context

#ghc

Last updated 1 year ago

hxameer :qed: · @xameer
233 followers · 6431 posts · Server mathstodon.xyz

it seems to work when I add

{-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise -fplugin GHC.TypeLits.KnownNat.Solver #-}
{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-redundant-constraints #-}

and change the function to

toNetInp :: forall m g st stRep layers shapes net iShape iShapeK nr len x .
(Network layers shapes ~ net, iShape ~ S iShapeK
, len ~ Size iShapeK, HeadShape iShapeK nr ~ (Head shapes)
, KnownNat (nr+1), KnownNat nr, (nr + 1) ~ (1 + nr)
, S x ~ iShape) =>
QLearner m g st stRep iShape nr net -> S x -> S (Head shapes)
toNetInp ql (S1D inpV) =
S2D $ (SV.dfold (Proxy :: Proxy (Append len)) stepDim1 base (fmap fromS lasts))
where base :: Append len @@ 0
base = SA.col inpV
fromS :: S ('D1 len) -> SA.L len 1
fromS (S1D x) = SA.col x
lasts = fmap (normInput ql) (ql ^. lastInputs)
stepDim1 :: SV.SNat l -> SA.L len 1 -> Append len @@ l -> Append len @@ (l+1)
stepDim1 SV.SNat y x = x SA.||| y

Note the signature of stepDim1. I removed the forall constraint completely. However, this only works with the ghc plugins enabled.
hackage.haskell.org/package/gh
hackage.haskell.org/package/gh
hackage.haskell.org/package/gh
reddit.com/r/haskell/comments/

#clash #ghc #haskell

Last updated 1 year ago

What's the equivalent of a dependent pair as a record field?

In , I'd define `TypeFn : Int -> Type` and then have the field be of type `(Int ** TypeFn)`. Yes, I need access to both projections of the dependent pair.

ISTR having to use singletons.

I do need to cover the case where the body of `TypeFn` has a wildcard, if that complicates things.

I'd like the system to be closed, and not have dangling (type class) constraints at the interface.

#ghc #haskell #idris

Last updated 1 year ago

Dieu · @hllizi
270 followers · 11349 posts · Server hespere.de

Is there a quick and simple explanation for non-compiler hackers why is a fork instead of just another GHC backend?

#eta #ghc #haskell

Last updated 1 year ago

Philipp :emacs: :nixos: · @pmidden
47 followers · 141 posts · Server fosstodon.org

Best way to install and under Windows?

#ghc #cabal #haskell

Last updated 1 year ago

hxameer :nixos: :emacs: · @hxameer
17 followers · 545 posts · Server fosstodon.org
· @DiazCarrete
20 followers · 164 posts · Server hachyderm.io
hxameer :qed: · @xameer
203 followers · 5715 posts · Server mathstodon.xyz

rules allow the use of this tool to analyse haskell_library coverage by haskell_test rules
Bazel supports the special persistent worker mode when, instead of calling the compiler from scratch to build every target separately, it spawns a resident process for this purpose and sends all compilation requests to it in the client-server fashion. This worker strategy may improve compilation times. We implemented a worker for GHC using API.

To activate the persistent worker mode in rules_haskell the user adds a couple of lines in the WORKSPACE file to load worker’s dependencies:

load("//tools:repositories.bzl", "rules_haskell_worker_dependencies")
rules_haskell_worker_dependencies()

#ghc #haskell

Last updated 1 year ago

· @DiazCarrete
18 followers · 145 posts · Server hachyderm.io

module-level build parallelism (-j) in vs package-level build parallelism (-j) in

"passing -j4 —ghc-option=-j4 to cabal can lead to 16 modules being compiled at the same time"
🔗
discourse.haskell.org/t/ghcs-j

#ghc #cabal #haskell

Last updated 1 year ago

Mizunashi Mana · @mizunashi_mana
42 followers · 79 posts · Server mstdn.mizunashi.work

GHC docs build battle...

#ghc #haskell

Last updated 1 year ago

hxameer :qed: · @xameer
198 followers · 5309 posts · Server mathstodon.xyz

STG machine is an essential part of , the world's leading Haskell compiler. It defines how the Haskell evaluation model should be efficiently implemented on standard hardware. Despite this key role, it is generally poorly understood amongst GHC users. This document aims to provide an overview of the STG machine in its modern, eval/apply-based, pointer-tagged incarnation by a series of simple examples showing how Haskell source code is compiled.
stackoverflow.com/questions/11

#ghc

Last updated 1 year ago

洪 民憙 (Hong Minhee) · @hongminhee
215 followers · 1367 posts · Server todon.eu

When will support on ? GHC currently supports ARM64 on Linux and macOS, but not just on Windows. GHC doesn't even support cross-compilation, so there's no way to build Windows binaries for ARM64 at this time.

#ghc #arm64 #windows

Last updated 1 year ago

Alan Zimmerman · @alanz
459 followers · 9102 posts · Server social.coop

Back to hacking a bit on , using a freshly-built . And I love the hole filling suggestions, getting the right conversion functions to fix the rebase,

#ghc #hls

Last updated 2 years ago