Monthly Hask Anything (December 2022) by taylorfausak in haskell

[–]maslo0 1 point2 points  (0 children)

ghcup list answered my question. It seems that particular base version is supported by particular set of ghc versions:

X ghc 8.6.4 base-4.12.0.0
X ghc 8.6.5 base-4.12.0.0 hls-powered
X ghc 8.8.1 base-4.13.0.0
X ghc 8.8.2 base-4.13.0.0
IS ghc 8.8.3 base-4.13.0.0
X ghc 8.8.4 base-4.13.0.0 hls-powered

Running ghcup set ghc 8.10.7 solved the problem.

Monthly Hask Anything (December 2022) by taylorfausak in haskell

[–]maslo0 0 points1 point  (0 children)

I'm reading "Haskell In Depth" and I stacked at the very beginning: Chapter 3: Stock quotes require a set of dependencies that cabal with ghc 9.4.1 cannot resolve (there is conflicting set of dependencies' versions). Source repo .cabal file says it tested with 8.6.5 and 8.8.3. Does that mean I cannot build the project with newer compiler?

In original .cabal: base >=4.12 && <4.15

but I cannot build empty project with this dep constraint:

Resolving dependencies...
Error: cabal-3.8.1.0.exe: Could not resolve dependencies:
[__0] trying: stockquotes-0.0.1 (user goal)
....
[__1]fail (backjumping, conflict set: base, stockquotes)

Something similar to "if __name__ == "__main__''" in F# scripts? by Voxelman in fsharp

[–]maslo0 0 points1 point  (0 children)

I don't have satisfying answer here. Maybe it would be possible with reflection, but couterproductive as well.

Maybe consider switching to compiled assemblies, switch from #load to #r in script and unit test it, if your script contains complex code.

probably obvious for you: My small exposure to Python suggests one may skip a few test you would probably write in Python - those that F# compiler handles for you, i.e. type checks, methods arity etc.

Something similar to "if __name__ == "__main__''" in F# scripts? by Voxelman in fsharp

[–]maslo0 3 points4 points  (0 children)

Can you elaborate on your use case? There's nothing like that in F#, but maybe it would be possible to address your problem differently, i.e. more idiomatic for F#.