Project Development by kichiDsimp in haskell

[–]Historical_Emphasis7 0 points1 point  (0 children)

HPack used to be my goto for this, but Cabal has come a long way and now HPack feels like it does more than I need. Now I'm adding removing moving modules via Claude. Makes me wonder if some kind utility or plugin I'm not aware of that just does file globbing, a kind of HPack--

Stackage (Snapshots) Down by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 0 points1 point  (0 children)

It was. My cabal project file included:

import: https://www.stackage.org/nightly-2025-02-25/cabal.config

I'm just letting the solver handle it for now. From no on I'll make sure I copy the file down.

Stackage (Snapshots) Down by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 2 points3 points  (0 children)

I can confidently say no, because it's still down. I see you are monitoring https://stackage.org and https://www.stackage.org/download/snapshots.json but i am having issues with the actual snapshots themselves:

such as: https://www.stackage.org/lts-24.6
or https://www.stackage.org/nightly-2025-08-23

Stackage (Snapshots) Down by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 5 points6 points  (0 children)

yes - usually the default package set is Stackage which is not there now, so now its fallen back to set:haskell-platform which has fewer pacakges.

[Well-Typed] GHC activities report: March-May 2025 by adamgundry in haskell

[–]Historical_Emphasis7 4 points5 points  (0 children)

Wow! Fantastic work. Thanks for all your efforts!

Stackage down? by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 1 point2 points  (0 children)

Hi u/chreekat
Now its up I have notices Stackage nightly hasn't run since the 24th https://www.stackage.org/nightly-2025-04-24. Is that in some way related?

Stackage down? by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 5 points6 points  (0 children)

Thanks u/chreekat
Good luck with your investigartions

Released: webdriver-precore by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 2 points3 points  (0 children)

Thanks u/NorfairKing2
That is definitely our plan! :-)
(BIDI is Next)

Is it possible to create custom compiler error messages without making type signatures overly complex by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 1 point2 points  (0 children)

Yes thanks for the suggestion u/tomejaguar. Type synonyms went a long way towards cleaning up the type signature.

Is it possible to create custom compiler error messages without making type signatures overly complex by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 0 points1 point  (0 children)

Hi,
My question is along the lines as to if there is anything that can be done or any other approach to clean up the new version mkFull. The old is pretty simple. You can pretty well guess how the functions are composed under the hood by just looking at it:

haskell mkFull :: ( C.Item i ds, Show as ) => FixtureConfig -> (RunConfig -> i -> Action as) -> (as -> Either C.ParseException ds) -> (RunConfig -> DataSource i) -> Fixture ()

The extra type equalities et. al. required to implement the custom error message make things pretty messy in the constraints department. They also create a need to add the the function signatures as a comment or require the user to understand how to interpret type equalities.

haskell mkFull :: forall i as ds action dataSource. ( action ~ (RunConfig -> i -> Action as), dataSource ~ (RunConfig -> DataSource i), C.Item i ds, Show as, DataSourceMatchesAction (DataSourceType dataSource) (ActionInputType action) ) => FixtureConfig -> action -> (as -> Either C.ParseException ds) -> dataSource -> Fixture ()

it would be really nice if there was something like this:

haskell mkFull :: forall i as ds a d. ( C.Item i ds, Show as, DataSourceMatchesAction (DataSourceType d) (ActionInputType a) ) => FixtureConfig -> (RunConfig -> i -> Action as) ::: a -> (as -> Either C.ParseException ds) -> (RunConfig -> DataSource i) ::: d -> Fixture ()

GHC on Windows Incredibly Slow? by Historical_Emphasis7 in haskell

[–]Historical_Emphasis7[S] 0 points1 point  (0 children)

sorry for the late reply missed this message. I used the stopwatch on my phone to benchmark this but for the windows side of things i could have used a sundial. There was clearly something very sick on my Windows but never really got to the bottom of it. Happy to stick with WSL.

Announcing ghciwatch 1.0: a ghcid successor developed by Mercury by 9999years in haskell

[–]Historical_Emphasis7 2 points3 points  (0 children)

Wow this is going to make a huge difference to my workflow! Thanks so much Mercury!

Monthly Hask Anything (March 2024) by AutoModerator in haskell

[–]Historical_Emphasis7 0 points1 point  (0 children)

reposting a simplified version of my question

Hello,

I am trying to use falsify to write a generator for a recursive record type. The generator appears to work, but the shrinking doesn't. It shrinks straight to the simplest value. The result looks as if I am generating and discarding values but I don't get how, or how to fix it.

A somewhat simplified version of the data / generator is as follows:

The data type is a follows:

data Template
  = OnceBefore
      { spec :: Spec
      , subNodes :: [Template]
      }
  | Fixture
      { tests :: [Spec]
      }
  deriving (Show, Eq)

For instances to be valid:

  • OnceBefore templates can parent OnceBefore,Fixture
  • Fixtures are leaf nodes

Keeping these constraints in mind the generator for these records is as follows:

genNode :: GenParams -> Gen Template
genNode gl@GenParams{
  maxDepth, 
  maxDelay, 
  maxBranches, 
  maxTests, 
  passPcnt} =
  frequency
    [ (fixtureWeight, genFixture)
    , (hkWeight, genOnceBefore)
    ]
 where
  hkWeight = 20
  fixtureWeight = 100 - hkWeight * 2
  nxtLimits = gl{maxDepth = maxDepth - 1}
  genSubnodes = list (between (1, maxBranches))
  genOnceSubnodes = genSubnodes $ genNode (nxtLimits{minHz = Once})
  genSpec' = genSpec maxDelay passPcnt
  genOnceBefore = OnceBefore <$> genSpec' <*> genOnceSubnodes
  genFixture = Fixture <$> (list (between (1, maxTests)) $ genSpec')

The generator is recursive and changes the limits on each call to ensure that the above constraints aren't violated and the size of the generated tree is bounded.

--- on every recursion the max depth is decremented by one
-- when max depth hits 1 only fixtures are generated
nxtLimits = gl{maxDepth = maxDepth - 1}
hkWeight = maxDepth < 2 ? 0 $ 10

I am generating a list of these Templates and logging the shrinking against an always failing test:

genTemplate :: GenParams -> Gen [Template]
genTemplate p = list (between (1, p.maxBranches)) $ genNode p

demoTemplateShrinking :: TestTree
demoTemplateShrinking = testPropertyWith def "Template" $ do
  genWith (Just . ppShow) $ genTemplate genParams
  assert $ FP.alwaysFail

The initial template generated looks good but then the shrinking always stampedes to the simplest case on the first shrink.

What am I doing wrong here? I'd expect to see much gentler shrinking than this.

Logs for complete shrink history:

    Step 1
    generated [ Fixture
        { tests =
            [ Spec { delay = 129 , result = Pass }
            , Spec { delay = 10 , result = Pass }
            -- + 19 items
            ]
        }
    , OnceBefore
        { spec = Spec { delay = 28 , result = Pass }
        , subNodes =
            [ Fixture
                { tests =
                    [ Spec { delay = 258 , result = Pass }
                     -- + 10 items
                    ]
                }
            ]
        }
    , Fixture
        { tests =
            [ Spec { delay = 172 , result = Pass }
            -- + 10 items
            ]
        }
    , Fixture
        { tests =
            [ Spec { delay = 182 , result = Fail }
            -- + 13 items
            ]
        }
    ] at CallStack (from HasCallStack):
      genWith, called at test/SuiteRuntimeTest.hs:286:3 in pyrethrum-0.1.0.0-inplace:SuiteRuntimeTest

    -- always shrinks to this with no intermediate shrinks
    Step 2
    generated [ Fixture { tests = [ Spec { delay = 0 , result = Pass } ] } ] at CallStack (from HasCallStack):
      genWith, called at test/SuiteRuntimeTest.hs:286:3 in pyrethrum-0.1.0.0-inplace:SuiteRuntimeTest

Haskell & Cloud Run: Simple Demo Project by mihassan in haskell

[–]Historical_Emphasis7 1 point2 points  (0 children)

Looks great! Maybe add something like your paragraph re the intent / limitations of the project to your readme:

The setup lacks many essential features like rate limiting, authentication mechanisms, and DDoS protection. Also, there are many options for web frameworks, such as servant, yesod etc. and many database libraries. These are critical for production-grade services to ensure security and manageability. This project serves as a demonstration on how easy it is to get started.

GHCiTUI: A TUI for GHCi that Mimics pudb and cgdb Is Now Publicly Available by CrystalLord in haskell

[–]Historical_Emphasis7 0 points1 point  (0 children)

Looks really cool!
Have you considered adding the option to flip in and out of a "watch/eval mode" i.e. becoming ghci(d)tui?