profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/knothed/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

piknotech/SFSafeSymbols 817

Safely access Apple's SF Symbols using static typing

JamitLabs/JamitFoundation 9

JamitFoundation is a collection of useful concepts to enable composition oriented development with UIKit

JamitLabs/Jetworking 4

A JamitLabs Networking abstraction for iOS

JamitLabs/JLCoordinator 4

A basic coordinator pattern implementation with presenter approach. Coordinators are managing the screen flow of your app and coordinating the connection between the UI and your models.

knothed/Fractals 4

My Winning Submission for Apple's WWDC 2020 Swift Student Challenge

knothed/Symmetries 4

My Winning Submission for Apple's WWDC 2021 Swift Student Challenge

piknotech/gnimag 3

The bot every gamer is fearing 🤖

piknotech/TrivialTorch 2

A fabulous flashlight

vossmalte/KIT-ElementareGeometrie 1

Notizen zur Vorlesung Elementare Geometrie WS 19/20 bei Prof. Tuschmann

push eventpiknotech/gnimag

David Knothe

commit sha 87a672956cf30e2b762606a57a460a69b6636ba7

Quick MrFlap fix for smartphones showing top and bottom borders

view details

David Knothe

commit sha 048710ab582e632b080db600fb7e37db688509c1

Help compiler type-checking

view details

push time in 19 hours

pull request commentsimonmar/happy

Split off happy-grammar and happy-tabular

Is there more feedback or are you happy with the MR? @int-index @Ericson2314

knothed

comment created time in 14 days

Pull request review commentsimonmar/happy

Split off happy-grammar and happy-tabular

+module Happy.Tabular (TabularArgs(..), Lr1State, TabularResult, runTabular) where++import Happy.Grammar.Grammar+import Happy.Tabular.Tables+import Happy.Tabular.First+import Happy.Tabular.LALR+import Happy.Tabular.FindRedundancies+import Happy.Tabular.Info+import Data.Set (Set)+import Data.Array (Array)+import System.IO+import System.Exit+import Control.Monad++-------- Main entry point (runTabular) --------++data TabularArgs = TabularArgs {+  inFile :: String, -- printed to the info file, not used otherwise+  infoFile :: Maybe String+  +#ifdef DEBUG++  , +  dumpLR0 :: Bool,+  dumpLA :: Bool,+  dumpAction :: Bool,+  dumpGoto :: Bool++#endif++}++type Lr1State = ([Lr1Item], [(Name, Int)])+type TabularResult = (ActionTable, GotoTable, [Lr1State], [Int])++runTabular :: TabularArgs -> Bool -> Grammar -> IO TabularResult+runTabular args glr g = +    let first       = {-# SCC "First" #-} (mkFirst g)+        closures    = {-# SCC "Closures" #-} (precalcClosure0 g)+        sets        = {-# SCC "LR0_Sets" #-} (genLR0items g closures)+        _lainfo@(spont,prop) = {-# SCC "Prop" #-} (propLookaheads g sets first)+        la          = {-# SCC "Calc" #-} (calcLookaheads (length sets) spont prop)+        items2      = {-# SCC "Merge" #-} (mergeLookaheadInfo la sets)+        goto        = {-# SCC "Goto" #-} (genGotoTable g sets)+        action      = {-# SCC "Action" #-} (genActionTable g first items2)+        (conflictArray,(sr,rr))   = {-# SCC "Conflict" #-} (countConflicts action)+    in do++#ifdef DEBUG++        optPrint (dumpLR0 args) (print sets)+        optPrint (dumpLA args) (print la)+        optPrint (dumpAction args) (print action)+        optPrint (dumpGoto args) (print goto)++#endif++        (unused_rules, unused_terminals) <- reportUnusedRules glr g action+        writeInfoFile sets g action goto conflictArray (inFile args) (infoFile args) unused_rules unused_terminals+        reportConflicts g sr rr+        return (action, goto, items2, unused_rules)++#ifdef DEBUG++    where+      optPrint b io = when b (putStr "\n---------------------\n" >> io)++#endif+++-------- Helpers --------++reportUnusedRules :: Bool -> Grammar -> ActionTable -> IO ([Int], [String])+reportUnusedRules glr g action = +    let reduction_filter = if glr then any_reduction else first_reduction+        (unused_rules, unused_terminals) = find_redundancies reduction_filter g action in do+    when (not (null unused_rules))+       (hPutStrLn stderr ("unused rules: " ++ show (length unused_rules)))+    when (not (null unused_terminals))+       (hPutStrLn stderr ("unused terminals: " ++ show (length unused_terminals)))+    return (unused_rules, unused_terminals)++reportConflicts :: Grammar -> Int -> Int -> IO ()+reportConflicts g sr rr = case expect g of+    Just n | n == sr && rr == 0 -> return ()+    Just _ | rr > 0 ->+        die' $ "The grammar has reduce/reduce conflicts.\n" +++               "This is not allowed when an expect directive is given\n"+    Just _ ->+        die' $ "The grammar has " ++ show sr ++ " shift/reduce conflicts.\n" +++               "This is different from the number given in the expect directive\n"+    _ -> do    +        if sr /= 0+          then hPutStrLn stderr ("shift/reduce conflicts:  " ++ show sr)+          else return ()+        +        if rr /= 0+          then hPutStrLn stderr ("reduce/reduce conflicts: " ++ show rr)+          else return ()++die' :: String -> IO a

True, this would work. The next MR will remove die' anyhow and replace it with a local function named die, so it doesn‘t really make any difference.

knothed

comment created time in 22 days

PullRequestReviewEvent

push eventpiknotech/happy

David Knothe

commit sha 71827da63bc58e727cc70f3411800f67b01641e0

Rename `die'` to `die`

view details

push time in 22 days

Pull request review commentsimonmar/happy

Split off happy-grammar and happy-tabular

+module Happy.Tabular (TabularArgs(..), Lr1State, TabularResult, runTabular) where++import Happy.Grammar.Grammar+import Happy.Tabular.Tables+import Happy.Tabular.First+import Happy.Tabular.LALR+import Happy.Tabular.FindRedundancies+import Happy.Tabular.Info+import Data.Set (Set)+import Data.Array (Array)+import System.IO+import System.Exit+import Control.Monad++-------- Main entry point (runTabular) --------++data TabularArgs = TabularArgs {+  inFile :: String, -- printed to the info file, not used otherwise+  infoFile :: Maybe String+  +#ifdef DEBUG++  , +  dumpLR0 :: Bool,+  dumpLA :: Bool,+  dumpAction :: Bool,+  dumpGoto :: Bool++#endif++}++type Lr1State = ([Lr1Item], [(Name, Int)])+type TabularResult = (ActionTable, GotoTable, [Lr1State], [Int])++runTabular :: TabularArgs -> Bool -> Grammar -> IO TabularResult+runTabular args glr g = +    let first       = {-# SCC "First" #-} (mkFirst g)+        closures    = {-# SCC "Closures" #-} (precalcClosure0 g)+        sets        = {-# SCC "LR0_Sets" #-} (genLR0items g closures)+        _lainfo@(spont,prop) = {-# SCC "Prop" #-} (propLookaheads g sets first)+        la          = {-# SCC "Calc" #-} (calcLookaheads (length sets) spont prop)+        items2      = {-# SCC "Merge" #-} (mergeLookaheadInfo la sets)+        goto        = {-# SCC "Goto" #-} (genGotoTable g sets)+        action      = {-# SCC "Action" #-} (genActionTable g first items2)+        (conflictArray,(sr,rr))   = {-# SCC "Conflict" #-} (countConflicts action)+    in do++#ifdef DEBUG++        optPrint (dumpLR0 args) (print sets)+        optPrint (dumpLA args) (print la)+        optPrint (dumpAction args) (print action)+        optPrint (dumpGoto args) (print goto)++#endif++        (unused_rules, unused_terminals) <- reportUnusedRules glr g action+        writeInfoFile sets g action goto conflictArray (inFile args) (infoFile args) unused_rules unused_terminals+        reportConflicts g sr rr+        return (action, goto, items2, unused_rules)++#ifdef DEBUG++    where+      optPrint b io = when b (putStr "\n---------------------\n" >> io)++#endif+++-------- Helpers --------++reportUnusedRules :: Bool -> Grammar -> ActionTable -> IO ([Int], [String])+reportUnusedRules glr g action = +    let reduction_filter = if glr then any_reduction else first_reduction+        (unused_rules, unused_terminals) = find_redundancies reduction_filter g action in do+    when (not (null unused_rules))+       (hPutStrLn stderr ("unused rules: " ++ show (length unused_rules)))+    when (not (null unused_terminals))+       (hPutStrLn stderr ("unused terminals: " ++ show (length unused_terminals)))+    return (unused_rules, unused_terminals)++reportConflicts :: Grammar -> Int -> Int -> IO ()+reportConflicts g sr rr = case expect g of+    Just n | n == sr && rr == 0 -> return ()+    Just _ | rr > 0 ->+        die' $ "The grammar has reduce/reduce conflicts.\n" +++               "This is not allowed when an expect directive is given\n"+    Just _ ->+        die' $ "The grammar has " ++ show sr ++ " shift/reduce conflicts.\n" +++               "This is different from the number given in the expect directive\n"+    _ -> do    +        if sr /= 0+          then hPutStrLn stderr ("shift/reduce conflicts:  " ++ show sr)+          else return ()+        +        if rr /= 0+          then hPutStrLn stderr ("reduce/reduce conflicts: " ++ show rr)+          else return ()++die' :: String -> IO a

No, die is exported by System.Exit, but only starting from base-4.8.0.0. For calling it die we'd need an #if MIN_VERSION_base, which will come in the following MR.

knothed

comment created time in 22 days

PullRequestReviewEvent

push eventpiknotech/happy

David Knothe

commit sha 5f89753363d398acb24c3a431bd31a7ea49ec4bc

Remove code changes

view details

push time in 22 days

pull request commentsimonmar/happy

Split off happy-grammar and happy-tabular

Done. Now the MR only contains pure code movements, namely the following:

  • Grammar, Production, Assoc, Priority: Mangler -> Grammar
  • mapDollarDollar: GenUtils -> Grammar
  • ErrorHandlerType: AbsSyn -> Grammar
  • mkClosure: GenUtils -> First
  • str, interleave, interleave': GenUtils -> Info (copy)
  • die, dieHappy, getProgramName, optPrint: Main -> GenUtils
  • die: Main -> Tabular
  • LRAction, Goto, ActionTable, GotoTable: Mangler -> Tables
  • find_redundancies, is_shift: Main -> FindRedundancies
  • any_reduction, first_reduction: Main -> Tabular

Also, the following wrapper functions around otherwise purely moved code have been created:

  • reportUnusedRules, reportConflicts, writeInfoFile, runTabular: Main -> Tabular
knothed

comment created time in 22 days

push eventpiknotech/happy

David Knothe

commit sha 16b23f4c7d7fe4c3db65934d82c091e1ccf7362c

Remove code changes

view details

push time in 22 days

pull request commentsimonmar/happy

Split off happy-grammar and happy-tabular

Okay, so I'll try splitting this and the following MRs into two MR's each: one where code is moved, but not changed, and one where code is changed, but not moved. I think it should be possible to do so, but I can't guarantee a 100% success.

Of course, moving code around will impact module and import statements.

knothed

comment created time in 22 days

push eventpiknotech/happy

David Knothe

commit sha 65e4a80fdca253112935d888544f5dc5425a6d0a

Update haskell-ci.yml

view details

push time in 25 days

push eventpiknotech/happy

David Knothe

commit sha bf85acae25c96f4cd40425e717ac56a31ba3e69a

Move GenUtils out of happy-grammar - Move mapDollarDollar to Grammar: the $$ feature is on grammar level - Move mkClosure into tabular as it is only used there

view details

push time in 25 days

push eventpiknotech/happy

David Knothe

commit sha b6def8532331207d4cc02d70344af22446dc3d9a

Declare `die` for GHC 7.8 and below

view details

push time in 25 days

push eventpiknotech/happy

David Knothe

commit sha 765be70756f2590c0e8f7698037103b2500cbdea

Declare `die` for GHC 7.8 and below

view details

push time in 25 days

startedjanek37/curve

started time in 25 days

pull request commentsimonmar/happy

Split off happy-grammar and happy-tabular

@int-index GenUtils is now back in happy and will be fully removed bit by bit.

knothed

comment created time in 25 days

push eventpiknotech/happy

David Knothe

commit sha 59131f15c9b24b546ee2cda0b9758a5284d62057

Move GenUtils out of happy-grammar - Move mapDollarDollar to Grammar: the $$ feature is on grammar level - Move mkClosure into tabular as it is only used there

view details

push time in 25 days

pull request commentsimonmar/happy

Modularize happy

I've removed GenUtils and distributed its members to sensible places:

  • mapDollarDollar to Grammar as it is a grammar-level feature and every backend working with Grammar uses it
  • dieHappy and friends to Happy.CLI.Dying. This makes Happy.*.CLI modules import Happy.CLI.Dying, which means frontend and backend now also depend on happy-cli. If this is unwanted, frontend and backend could outsource their CLI module into frontend-cli and backend-cli.
  • The remaining members are put directly in the packages where they're used.
knothed

comment created time in 25 days

push eventknothed/happy-rad

David Knothe

commit sha bad039d91f5377661a0816f12a11a59303a0dfcf

Make packages link relative

view details

push time in 25 days

push eventknothed/happy-rad

David Knothe

commit sha ea6bd8474fc03aebe883567387be9ba4075ba5fd

Adapt to GenUtils liquidation

view details

push time in 25 days

push eventpiknotech/happy

David Knothe

commit sha 9db33f3cedd9afac0951eff00eac5528f7fe3d8b

Liquidate GenUtils - Put "mapDollarDollar" in Grammar - Put "die" and "dieHappy" in Happy.CLI.Dying - Put the other stuff where it is used.

view details

push time in 25 days

push eventpiknotech/happy

David Knothe

commit sha 61626b0adbfa692eea3fc5118d14500122377c7e

Fix appveyor

view details

push time in 25 days

push eventpiknotech/happy

David Knothe

commit sha 12b41ed90735a96be63598fdc6e560c2f1c8e734

Fix appveyor

view details

push time in a month

pull request commentsimonmar/happy

Split off happy-grammar and happy-tabular

True, GenUtils preferably shouldn't exist. I'll add its functions directly into the packages that need them.

knothed

comment created time in a month

push eventpiknotech/happy

David Knothe

commit sha f2560f31a6bf9a69b9f9f8eb3a7b3929b131a2b4

Fix appveyor

view details

push time in a month

pull request commentsimonmar/happy

Modularize happy

I decided for the following path:

  1. Split off happy-grammar and happy-tabular
  2. Split off happy-frontend, happy-backend and happy-backend-glr
  3. Create happy and happy-cli
  4. Create happy-test.

Changing all the CLI stuff at once and at the end is the most convenient, both for doing so and for reviewing.

@int-index The first MR is #200 which can be reviewed now.

Maybe it makes more sense to merge all the MRs into an intermediate branch and then merge that branch into master only at the end. Maybe someone could create a branch (e.g. modularisation).

knothed

comment created time in a month

PR opened simonmar/happy

Split off happy-grammar and happy-tabular

#191

Create happy-grammar and happy-tabular.

+526 -412

0 comment

23 changed files

pr created time in a month

push eventpiknotech/happy

David Knothe

commit sha 8f155a9d81c764d96f99503142c9701fd313da71

Create happy-tabular package - Move things out of Main - call `runTabular` from Main

view details

push time in a month

create barnchpiknotech/happy

branch : grammar-and-tabular

created branch time in a month