profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/mattpolzin/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.
Mathew Polzin mattpolzin @opallabs Pullman, WA

mattpolzin/JSONAPI 56

Swift Codable JSON:API framework

mattpolzin/authenticated_data 4

Playing with authenticated data structures

mattpolzin/ajv 1

The fastest JSON Schema Validator. Supports draft-04/06/07

mattpolzin/auth 1

👤 Authentication and Authorization framework for Fluent.

mattpolzin/FileCheck 1

A standalone Swift version of LLVM's flexible pattern matching file verifier

mattpolzin/fluent-postgresql 1

🖋🐘 Swift ORM (queries, models, relations, etc) built on PostgreSQL.

mattpolzin/FootlessParser 1

A simple parser combinator written in Swift

mattpolzin/idris-adds 1

Random Idris 2 stuff that might be generally useful to me in the future.

mattpolzin/json-api 1

A specification for building JSON APIs

issue openedidris-lang/Idris2

Totality check failed via `case`.

Totality check failed via case. 0.3.0-42d4c3683

Steps to Reproduce

filter0 : (a -> Bool) -> List a -> List a
filter0 p       []  = []
filter0 p (x :: xs) = if p x then x :: filter0 p xs else filter0 p xs

filter0' : (a -> Bool) -> List a -> List a
filter0' p = \case
  [] => []
  x :: xs => if p x
    then x :: filter0' p xs
    else      filter0' p xs

Observed Behavior

filter0' is not total, possibly not terminating due to recursive path Main.filter0' -> Main.filter0' -> Main.filter0'

created time in 26 minutes

startedmattpolzin/VaporOpenAPI

started time in an hour

startedmattpolzin/OpenAPIKit

started time in an hour

issue commentvapor/vapor

Possible memory "leak" under Linux

I changed my https://github.com/gipfelen/vaporLinuxLeak such that it uses jemalloc instead of malloc. But after a single call of http://localhost:8080/hello it uses more than 800MB of RAM, and it doesn't get freed (even after 5min +).

gipfelen

comment created time in an hour

pull request commentidris-lang/Idris2

Use `sha256` instead of modification time to determine if module needs rebuilding

Ok, this new behavior is now behind an experimental flag (-Xcheck-hashes)

There is still a need for a windows Idris-dev since I don't have a windows machine and removing the escape didn't solve the issue. (I could leave the windows version unimplemented and leave a constant string in place but that would be less than ideal. UnU)

fabianhjr

comment created time in 10 hours

push eventidris-lang/Idris2

Fabián Heredia Montiel

commit sha dad4dcdaf8536ce7cd937a9e0c87ecafa0ae6b93

Add totality annotations to `src` and `libs/{prelude, base}`

view details

Denis Buzdalov

commit sha bf0985602f06d4cbbd4f9f25af02eefc943957eb

[ totality ] More `%default total` stuff

view details

André Videla

commit sha 161ea5d50a1c0ad9466c2ce6be4a4704e036efbc

Merge pull request #1521 from LibreCybernetics/add-totality-annotatations Add totality annotations to `src` and `libs/{prelude, base}`

view details

push time in 12 hours

PR merged idris-lang/Idris2

Add totality annotations to `src` and `libs/{prelude, base}`

50 %default total (1 was a %default covering) and 21 %default covering.

Edit: Thanks to @buzden 54 %default total (5 were %default covering) and 17 %default covering.

+161 -19

7 comments

72 changed files

fabianhjr

pr closed time in 12 hours

pull request commentidris-lang/Idris2

Add totality annotations to `src` and `libs/{prelude, base}`

Yeah I was just wating for @buzden 's comment on the interface change, let's just merge it for now, nothing too controversial here

fabianhjr

comment created time in 12 hours

pull request commentidris-lang/Idris2

Add totality annotations to `src` and `libs/{prelude, base}`

Hey @andrevidela, I am confident that this PR is not over 1% slowdown and totality checking would be desirable. Though if there is another benchmark you would want me to run I would be more than happy to run them.

fabianhjr

comment created time in 13 hours

startedgenevievecurry/phoenix-password-generator

started time in 13 hours

issue commentvapor/vapor

Possible memory "leak" under Linux

I had a similar issue, memory use increased over time using Linux until the app crashed while the same code had no issues on macOS. I was able to solve this by implementing jemalloc in my container

Deployed my Vapor Docker Container on CloudFoundry with 1GB RAM allocated. Since last week I tested my code under production conditions, decoding an 15MB-ish JSON every hour and writing this data to an internal Fluent SQLite DB. I noticed that now over time more and more RAM was used until the container crashed. @Lukasa mentioned jemalloc, hence I googled a bit and found that some other communities had similar issues and overcame them by using this allocator. Using jemalloc my RAM is looking great, after 24hours at about 80MB used. Previously it would have crashed 3 times by now.

My Dockerfile: [...]

================================

Run image

================================

FROM swift:5.4-focal-slim

Make sure all system packages are up to date.

RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true &&
apt-get -q update && apt-get -q dist-upgrade -y && apt-get -y install libjemalloc2 && rm -r /var/lib/apt/lists/*

ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so**

[...]

gipfelen

comment created time in 14 hours

Pull request review commentidris-lang/Idris2

Add color to tests

 runTest opts testPath = forkIO $ do     printTiming True  clock msg = putStrLn (unwords [msg, show clock])     printTiming False _     msg = putStrLn msg +    wrapColor : Int -> Bool -> String -> String+    wrapColor color bold s = "\x1b[" ++ (if bold then "1;" else "0;") +++      show color ++ "m" ++ s ++ "\x1b[0m"+

Merginig would be great, yeah I could have done that wraping/unwrapping but then the 2 line wrapColor helper would have ended shorter than using Control.ANSI. unu

fabianhjr

comment created time in 14 hours

Pull request review commentidris-lang/Idris2

Add color to tests

 runTest opts testPath = forkIO $ do     printTiming True  clock msg = putStrLn (unwords [msg, show clock])     printTiming False _     msg = putStrLn msg +    wrapColor : Int -> Bool -> String -> String+    wrapColor color bold s = "\x1b[" ++ (if bold then "1;" else "0;") +++      show color ++ "m" ++ s ++ "\x1b[0m"+

We can open a PR to improve the ANSI API and add the change there. On the matter of the API, you can already have bolded and colored text, but you have to construct or unwrap DecoratedString manually. We can probably add a function that merges the decoration annotations of multiple helpers like bolden or colored, just for ergonomics.

fabianhjr

comment created time in 14 hours

push eventidris-lang/Idris2

Fabián Heredia Montiel

commit sha 4c995370625ee5747dd95109821fcafdb4103633

Add color to tests

view details

André Videla

commit sha 508ef8d0ce2eca92c20822f470822865c972193f

Merge pull request #1527 from LibreCybernetics/color-tests Add color to tests

view details

push time in 15 hours

PR merged idris-lang/Idris2

Add color to tests

image

+24 -8

0 comment

2 changed files

fabianhjr

pr closed time in 15 hours

Pull request review commentidris-lang/Idris2

Add color to tests

 runTest opts testPath = forkIO $ do     printTiming True  clock msg = putStrLn (unwords [msg, show clock])     printTiming False _     msg = putStrLn msg +    wrapColor : Int -> Bool -> String -> String+    wrapColor color bold s = "\x1b[" ++ (if bold then "1;" else "0;") +++      show color ++ "m" ++ s ++ "\x1b[0m"+

Yes

fabianhjr

comment created time in 15 hours

Pull request review commentidris-lang/Idris2

Add color to tests

 runTest opts testPath = forkIO $ do     printTiming True  clock msg = putStrLn (unwords [msg, show clock])     printTiming False _     msg = putStrLn msg +    wrapColor : Int -> Bool -> String -> String+    wrapColor color bold s = "\x1b[" ++ (if bold then "1;" else "0;") +++      show color ++ "m" ++ s ++ "\x1b[0m"+

Well, not gonna bikeshed the use of bold so this could be merged with only the color changes.

fabianhjr

comment created time in 16 hours

Pull request review commentidris-lang/Idris2

Add color to tests

 runTest opts testPath = forkIO $ do     printTiming True  clock msg = putStrLn (unwords [msg, show clock])     printTiming False _     msg = putStrLn msg +    wrapColor : Int -> Bool -> String -> String+    wrapColor color bold s = "\x1b[" ++ (if bold then "1;" else "0;") +++      show color ++ "m" ++ s ++ "\x1b[0m"+

I didn't realise that, maybe that's also the opportunity to revise the ANSI api. I think @ShinKage was the one to write it. What do you think @ShinKage ? should we open an issue to update the ANSI API to allow colored and bolded text?

fabianhjr

comment created time in 16 hours

Pull request review commentidris-lang/Idris2

Add color to tests

 runTest opts testPath = forkIO $ do     printTiming True  clock msg = putStrLn (unwords [msg, show clock])     printTiming False _     msg = putStrLn msg +    wrapColor : Int -> Bool -> String -> String+    wrapColor color bold s = "\x1b[" ++ (if bold then "1;" else "0;") +++      show color ++ "m" ++ s ++ "\x1b[0m"+

I am having issues mixing up bolden and colored together since

bolden : String -> DecoratedString
colored : Color -> String -> DecoratedString

And the only DecoratedString -> other is a field accesor or show = escapeSGR dstr.sgr ++ dstr.str ++ escapeSGR [Reset]

Will use Control.ANSI without bold for the time being; pushed the changes.

fabianhjr

comment created time in 17 hours

PR opened idris-lang/Idris2

Use map for some maybes
+20 -38

0 comment

7 changed files

pr created time in 17 hours

issue closedidris-lang/Idris2

void should work in linear context

module LinearVoid

foo : (1 _ : Char) -> (x : Maybe (Int -> Void)) -> Char
foo v Nothing = v
foo v (Just y) = void (y 5)

The above doesn't typecheck with: While processing right hand side of foo. There are 0 uses of linear name v.

void should work regardless if in a linear context or not.

closed time in 18 hours

redfish64

issue commentidris-lang/Idris2

void should work in linear context

This looks like correct behaviour to me. v isn't used in the second clause, and there's nothing magical about void that would make the linearity checker know it can ignore v. So, I'm going to close this one.

redfish64

comment created time in 18 hours

issue closedidris-lang/Idris2

Confusing behaviour in fromInteger

#1539 seems to have introduced a regression: everything works with the previous master commit ec1e7c0d, but unexpected behaviour is shown on the next commit 663a8381.

Steps to Reproduce

This module sets up the bounded Nat called Size, and declares a fromInteger that coerces anything over the upperbound to its max value.

On its own, this works as expected.


module Size

import Data.Maybe
import Data.Nat

MaxSizeNat : Nat
MaxSizeNat = 100

public export
record Size where
  constructor MkSize
  size : Nat
  0 sizeOk : LTE n MaxSizeNat

mkSize : (n : Nat) -> {auto 0 ok : LTE n MaxSizeNat} -> Size
mkSize n = MkSize n ok

maxSize : Size
maxSize = mkSize MaxSizeNat {ok=lteRefl}

export
mkSizeMay : Nat -> Maybe Size
mkSizeMay k with (isLTE k MaxSizeNat)
  mkSizeMay k | (Yes prf) = Just $ mkSize k
  mkSizeMay k | (No contra) = Nothing

export
fromInteger : Integer -> Size
fromInteger = fromMaybe maxSize . mkSizeMay . fromInteger

The issue arises when idris2 tries to build this:

module Usage

import Size

upperbound : Size
upperbound = 400

explicit : Size
explicit = fromInteger 42

-- elaborated : Size
-- elaborated = 42

Expected Behavior

All three cases behave identically.

Historically, they all pass, without requiring Usage to import Data.Maybe and Data.Nat.

Observed Behavior

elaborated fails when uncommented, with Error: While processing right hand side of elaborated. Undefined name Data.Maybe.fromMaybe.

closed time in 18 hours

claymager

issue commentidris-lang/Idris2

Confusing behaviour in fromInteger

I'm going to close this since I think the behaviour now is as good as it can be - I moved it to LHS only. Though at some point I'll see if we can make linearity checking possible in more cases, without knowing the types of unimported things (maybe if there's no linear bindings, for example).

claymager

comment created time in 18 hours

push eventidris-lang/Idris2

Edwin Brady

commit sha 19cb2681bec34c10e84adccffc0c9835b42ad041

Only fully normalise fromInteger on LHS This reduces surprising undefined name errors on the RHS, as noted in issue #1541

view details

Edwin Brady

commit sha 97ee3d4cd3784103c32990fd6bf5bbb98a76a9c1

Check LHS arguments are polymorphic enough We already did this, but missed a few cases due to the way arguments are elaborated. So now, when checking an LHS, we don't allow LHS argument types to be inferred from the pattern, but rather they must be inferred from elsewhere. To do this, we keep track of the constraints which would be solved when inferring the type, and make sure they don't solve any new metavariables. Fixes #1510, and also now gets the error location right as a bonus!

view details

Edwin Brady

commit sha 40fa9b43a7482cf984b4c5deba262ce0ff59141c

Merge pull request #1547 from edwinb/fix1510 A couple of fixes

view details

push time in 18 hours

PR merged idris-lang/Idris2

A couple of fixes

One to improve elaboration of fromInteger so we only fully normalise on the LHS. Another to fix #1510 and properly check whether LHS patterns are polymorphic enough.

+247 -67

0 comment

30 changed files

edwinb

pr closed time in 18 hours

issue closedidris-lang/Idris2

Tuple bug

Steps to Reproduce

tupleBug : ((), a) -> ()
tupleBug (_, _, _) = ()

Expected Behavior

Should error

Observed Behavior

No error

closed time in 18 hours

michaelmesser

issue commentidris-lang/Idris2

Tuple bug

Phew, that turned out to be quite a rabbit hole. But I've changed the way we check whether LHS arguments are polymorphic enough now, to make sure we check all of them, not just the ones that happen to be checkable on a first pass.

michaelmesser

comment created time in 20 hours

PR opened idris-lang/Idris2

A couple of fixes

One to improve elaboration of fromInteger so we only fully normalise on the LHS. Another to fix #1510 and properly check whether LHS patterns are polymorphic enough.

+247 -67

0 comment

30 changed files

pr created time in 20 hours