Skip to content

Law-abiding Apply NonEmptyList that agrees with Apply List #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
884f339
Update ci.yml
UnrelatedString Feb 27, 2025
aeed7b3
my toUnfoldable(1) tweak seems to compile and pass tests in the non-L…
UnrelatedString Feb 27, 2025
ae20e88
And it seems to work copy-pasted in Data.List.Lazy.NonEmpty
UnrelatedString Feb 27, 2025
9774982
Added tests for toUnfoldable (both my NonEmpty reimpls and the normal…
UnrelatedString Feb 27, 2025
e88840f
Update CHANGELOG.md
UnrelatedString Feb 27, 2025
ed16fa4
oh yeah, iterate IS in NonEmpty
UnrelatedString Feb 27, 2025
048081a
Update CHANGELOG.md
UnrelatedString Feb 27, 2025
34f77a8
Merge pull request #1 from UnrelatedString/unfoldable1
UnrelatedString Feb 27, 2025
46d0273
...aaaaaaaaaand of course local deps can't read bower. whatever at le…
UnrelatedString Apr 29, 2025
91944fa
oops
UnrelatedString Apr 29, 2025
5a2cf21
ooops
UnrelatedString Apr 29, 2025
1bc783e
so wait I can't even ... ???
UnrelatedString Apr 29, 2025
0b5f98e
nope
UnrelatedString Apr 29, 2025
aa60155
...just hope this works I guess LMAO
UnrelatedString Apr 29, 2025
0c920af
so. anything too new literally CAN'T be on Bower because the whole th…
UnrelatedString Apr 29, 2025
147deb1
...wait this might actually work. just. the same thing but with bower…
UnrelatedString Apr 29, 2025
67d5980
all that to add transitive dependencies for the one thing that doesn'…
UnrelatedString Apr 29, 2025
6857984
that line is LITERALLY NOT IN THE LOCAL COPY of course somehow the fo…
UnrelatedString Apr 29, 2025
4027829
WHATTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
UnrelatedString Apr 29, 2025
f75feca
AAHAKFHKHAHAHAHFASHFJSHFJASFH?AJSFHASDFHAWJFHASFGASHDFAJSERFHASERFL .…
UnrelatedString Apr 29, 2025
83a1ee9
...also fixing errors in the test code while I'm at it...
UnrelatedString Apr 29, 2025
d4e07c5
YESSSSS WE ARE SO BACKKKKKKKK
UnrelatedString Apr 29, 2025
964ac75
...and actually let the CI run on this branch LMAO
UnrelatedString Apr 29, 2025
bd3cacc
uhhhhhh
UnrelatedString Apr 29, 2025
1869ac5
phew......
UnrelatedString Apr 29, 2025
25a3881
Apply and Applicative :D
UnrelatedString Apr 29, 2025
5d2c90e
and there's the failure :DDDDDDDDD finallyyyyyyyy
UnrelatedString Apr 29, 2025
dad7ea2
same problem. much easier to read. also more problems oops lmao
UnrelatedString Apr 29, 2025
98992f1
no problems! just also kinda always recomputes the first element whic…
UnrelatedString Apr 29, 2025
0da9144
monad laws while I'm at it
UnrelatedString Apr 30, 2025
c9443ec
WAIT IT WAS LITERALLY JUST THAT AAAAAAAAAA
UnrelatedString Apr 30, 2025
1220624
ported fix to lazy but porting tests is a wee bit trickier
UnrelatedString Apr 30, 2025
04542ba
okay you know what I'm just not going to overdo it. better programmer…
UnrelatedString May 2, 2025
345e1db
Update CHANGELOG.md
UnrelatedString May 2, 2025
46e1604
...this test might help
UnrelatedString May 2, 2025
ccafbe8
Merge branch 'main' into fixed-apply-instance for nice new test
UnrelatedString May 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
...aaaaaaaaaand of course local deps can't read bower. whatever at le…
…ast this is *getting* there and a vastly better idea than the other stuff I tried. afraid of actually putting a spago.yaml in the top level since that could mess with publishing though... copying the dependencies in seems bad for maintainability but for something this low level with so few dependencies I guess it should be Fine
  • Loading branch information
UnrelatedString committed Apr 29, 2025
commit 46d027340cc9948356f2457f5b209a610ee2ee5d
15 changes: 15 additions & 0 deletions quickcheck/.spago/BuildInfo.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- @inline export packages always
-- @inline export pursVersion always
-- @inline export spagoVersion always
module Spago.Generated.BuildInfo where

packages :: { "lists-spec-tests" :: String }
packages =
{ "lists-spec-tests": "0.0.0"
}

pursVersion :: String
pursVersion = "0.15.15"

spagoVersion :: String
spagoVersion = "0.93.43"
1 change: 1 addition & 0 deletions quickcheck/output/Prim.Boolean/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"comments":"The Prim.Boolean module is embedded in the PureScript compiler. Unlike `Prim`, it is not imported implicitly. It contains a type level `Boolean` data structure.","declarations":[{"children":[],"comments":"The 'True' boolean type.\n","info":{"declType":"externData","kind":{"annotation":[],"contents":[["Prim"],"Boolean"],"tag":"TypeConstructor"},"roles":[]},"kind":null,"sourceSpan":null,"title":"True"},{"children":[],"comments":"The 'False' boolean type.\n","info":{"declType":"externData","kind":{"annotation":[],"contents":[["Prim"],"Boolean"],"tag":"TypeConstructor"},"roles":[]},"kind":null,"sourceSpan":null,"title":"False"}],"name":"Prim.Boolean","reExports":[]}
1 change: 1 addition & 0 deletions quickcheck/output/Prim.Coerce/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"comments":"The Prim.Coerce module is embedded in the PureScript compiler. Unlike `Prim`, it is not imported implicitly. It contains an automatically solved type class for coercing types that have provably-identical runtime representations with [purescript-safe-coerce](https://pursuit.purescript.org/packages/purescript-safe-coerce).","declarations":[{"children":[],"comments":"Coercible is a two-parameter type class that has instances for types `a`\nand `b` if the compiler can infer that they have the same representation.\nCoercible constraints are solved according to the following rules:\n\n* _reflexivity_, any type has the same representation as itself:\n`Coercible a a` holds.\n\n* _symmetry_, if a type `a` can be coerced to some other type `b`, then `b`\ncan also be coerced back to `a`: `Coercible a b` implies `Coercible b a`.\n\n* _transitivity_, if a type `a` can be coerced to some other type `b` which\ncan be coerced to some other type `c`, then `a` can also be coerced to `c`:\n`Coercible a b` and `Coercible b c` imply `Coercible a c`.\n\n* Newtypes can be freely wrapped and unwrapped when their constructor is\nin scope:\n\n newtype Age = Age Int\n\n`Coercible Int Age` and `Coercible Age Int` hold since `Age` has the same\nruntime representation than `Int`.\n\nNewtype constructors have to be in scope to preserve abstraction. It's\ncommon to declare a newtype to encode some invariants (non emptiness of\narrays with `Data.Array.NonEmpty.NonEmptyArray` for example), hide its\nconstructor and export smart constructors instead. Without this restriction,\nthe guarantees provided by such newtypes would be void.\n\n* If none of the above are applicable, two types of kind `Type` may be\ncoercible, but only if their heads are the same. For example,\n`Coercible (Maybe a) (Either a b)` does not hold because `Maybe` and\n`Either` are different. Those types don't share a common runtime\nrepresentation so coercing between them would be unsafe. In addition their\narguments may need to be identical or coercible, depending on the _roles_\nof the head's type parameters. Roles are documented in [the PureScript\nlanguage reference](https://github.com/purescript/documentation/blob/master/language/Roles.md).\n\nCoercible being polykinded, we can also coerce more than types of kind `Type`:\n\n* Rows are coercible when they have the same labels, when the corresponding\npairs of types are coercible and when their tails are coercible:\n`Coercible ( label :: a | r ) ( label :: b | s )` holds when\n`Coercible a b` and `Coercible r s` do. Closed rows cannot be coerced to\nopen rows.\n\n* Higher kinded types are coercible if they are coercible when fully\nsaturated: `Coercible (f :: _ -> Type) (g :: _ -> Type)` holds when\n`Coercible (f a) (g a)` does.\n\nThis rule may seem puzzling since there is no term of type `_ -> Type` to\napply `coerce` to, but it is necessary when coercing types with higher\nkinded parameters.\n","info":{"arguments":[["a",{"annotation":[],"contents":"k","tag":"TypeVar"}],["b",{"annotation":[],"contents":"k","tag":"TypeVar"}]],"declType":"typeClass","fundeps":[],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Coercible"}],"name":"Prim.Coerce","reExports":[]}
1 change: 1 addition & 0 deletions quickcheck/output/Prim.Int/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"comments":"The Prim.Int module is embedded in the PureScript compiler. Unlike `Prim`, it is not imported implicitly. It contains automatically solved type classes for working with type-level intural numbers.","declarations":[{"children":[],"comments":"Compiler solved type class for adding type-level `Int`s.\n","info":{"arguments":[["left",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}],["right",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}],["sum",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}]],"declType":"typeClass","fundeps":[[["left","right"],["sum"]],[["left","sum"],["right"]],[["right","sum"],["left"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Add"},{"children":[],"comments":"Compiler solved type class for comparing two type-level `Int`s.\nProduces an `Ordering`.\n","info":{"arguments":[["left",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}],["right",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}],["ordering",{"annotation":[],"contents":[["Prim","Ordering"],"Ordering"],"tag":"TypeConstructor"}]],"declType":"typeClass","fundeps":[[["left","right"],["ordering"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Compare"},{"children":[],"comments":"Compiler solved type class for multiplying type-level `Int`s.\n","info":{"arguments":[["left",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}],["right",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}],["product",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}]],"declType":"typeClass","fundeps":[[["left","right"],["product"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Mul"},{"children":[],"comments":"Compiler solved type class for converting a type-level `Int` into a type-level `String` (i.e. `Symbol`).\n","info":{"arguments":[["int",{"annotation":[],"contents":[["Prim"],"Int"],"tag":"TypeConstructor"}],["string",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}]],"declType":"typeClass","fundeps":[[["int"],["string"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"ToString"}],"name":"Prim.Int","reExports":[]}
1 change: 1 addition & 0 deletions quickcheck/output/Prim.Ordering/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"comments":"The Prim.Ordering module is embedded in the PureScript compiler. Unlike `Prim`, it is not imported implicitly. It contains a type level `Ordering` data structure.","declarations":[{"children":[],"comments":"The `Ordering` kind represents the three possibilities of comparing two\ntypes of the same kind: `LT` (less than), `EQ` (equal to), and\n`GT` (greater than).\n","info":{"declType":"externData","kind":{"annotation":[],"contents":[["Prim"],"Type"],"tag":"TypeConstructor"},"roles":[]},"kind":null,"sourceSpan":null,"title":"Ordering"},{"children":[],"comments":"The 'less than' ordering type.\n","info":{"declType":"externData","kind":{"annotation":[],"contents":[["Prim","Ordering"],"Ordering"],"tag":"TypeConstructor"},"roles":[]},"kind":null,"sourceSpan":null,"title":"LT"},{"children":[],"comments":"The 'equal to' ordering type.\n","info":{"declType":"externData","kind":{"annotation":[],"contents":[["Prim","Ordering"],"Ordering"],"tag":"TypeConstructor"},"roles":[]},"kind":null,"sourceSpan":null,"title":"EQ"},{"children":[],"comments":"The 'greater than' ordering type.\n","info":{"declType":"externData","kind":{"annotation":[],"contents":[["Prim","Ordering"],"Ordering"],"tag":"TypeConstructor"},"roles":[]},"kind":null,"sourceSpan":null,"title":"GT"}],"name":"Prim.Ordering","reExports":[]}
1 change: 1 addition & 0 deletions quickcheck/output/Prim.Row/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"comments":"The Prim.Row module is embedded in the PureScript compiler. Unlike `Prim`, it is not imported implicitly. It contains automatically solved type classes for working with row types.","declarations":[{"children":[],"comments":"The Union type class is used to compute the union of two rows of types\n(left-biased, including duplicates).\n\nThe third type argument represents the union of the first two.\n","info":{"arguments":[["left",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}],["right",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}],["union",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}]],"declType":"typeClass","fundeps":[[["left","right"],["union"]],[["right","union"],["left"]],[["union","left"],["right"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Union"},{"children":[],"comments":"The Nub type class is used to remove duplicate labels from rows.\n","info":{"arguments":[["original",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}],["nubbed",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}]],"declType":"typeClass","fundeps":[[["original"],["nubbed"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Nub"},{"children":[],"comments":"The Lacks type class asserts that a label does not occur in a given row.\n","info":{"arguments":[["label",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],["row",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}]],"declType":"typeClass","fundeps":[],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Lacks"},{"children":[],"comments":"The Cons type class is a 4-way relation which asserts that one row of\ntypes can be obtained from another by inserting a new label/type pair on\nthe left.\n","info":{"arguments":[["label",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],["a",{"annotation":[],"contents":"k","tag":"TypeVar"}],["tail",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}],["row",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}]],"declType":"typeClass","fundeps":[[["label","a","tail"],["row"]],[["label","row"],["a","tail"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Cons"}],"name":"Prim.Row","reExports":[]}
1 change: 1 addition & 0 deletions quickcheck/output/Prim.RowList/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"comments":"The Prim.RowList module is embedded in the PureScript compiler. Unlike `Prim`, it is not imported implicitly. It contains a type level list (`RowList`) that represents an ordered view of a row of types.","declarations":[{"children":[],"comments":"A type level list representation of a row of types.\n","info":{"declType":"externData","kind":{"annotation":[],"contents":[{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Function"],"tag":"TypeConstructor"},{"annotation":[],"contents":[["Prim"],"Type"],"tag":"TypeConstructor"}],"tag":"TypeApp"},{"annotation":[],"contents":[["Prim"],"Type"],"tag":"TypeConstructor"}],"tag":"TypeApp"},"roles":[]},"kind":null,"sourceSpan":null,"title":"RowList"},{"children":[],"comments":"Constructs a new `RowList` from a label, a type, and an existing tail\n`RowList`. E.g: `Cons \"x\" Int (Cons \"y\" Int Nil)`.\n","info":{"declType":"externData","kind":{"annotation":[],"contents":{"identifier":"k","kind":{"annotation":[],"contents":[["Prim"],"Type"],"tag":"TypeConstructor"},"skolem":null,"type":{"annotation":[],"contents":[{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Function"],"tag":"TypeConstructor"},{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],"tag":"TypeApp"},{"annotation":[],"contents":[{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Function"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"},{"annotation":[],"contents":[{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Function"],"tag":"TypeConstructor"},{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim","RowList"],"RowList"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}],"tag":"TypeApp"},{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim","RowList"],"RowList"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}],"tag":"TypeApp"}],"tag":"TypeApp"}],"tag":"TypeApp"},"visibility":"TypeVarInvisible"},"tag":"ForAll"},"roles":[]},"kind":null,"sourceSpan":null,"title":"Cons"},{"children":[],"comments":"The empty `RowList`.\n","info":{"declType":"externData","kind":{"annotation":[],"contents":{"identifier":"k","kind":{"annotation":[],"contents":[["Prim"],"Type"],"tag":"TypeConstructor"},"skolem":null,"type":{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim","RowList"],"RowList"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"},"visibility":"TypeVarInvisible"},"tag":"ForAll"},"roles":[]},"kind":null,"sourceSpan":null,"title":"Nil"},{"children":[],"comments":"Compiler solved type class for generating a `RowList` from a closed row\nof types. Entries are sorted by label and duplicates are preserved in\nthe order they appeared in the row.\n","info":{"arguments":[["row",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim"],"Row"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}],["list",{"annotation":[],"contents":[{"annotation":[],"contents":[["Prim","RowList"],"RowList"],"tag":"TypeConstructor"},{"annotation":[],"contents":"k","tag":"TypeVar"}],"tag":"TypeApp"}]],"declType":"typeClass","fundeps":[[["row"],["list"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"RowToList"}],"name":"Prim.RowList","reExports":[]}
1 change: 1 addition & 0 deletions quickcheck/output/Prim.Symbol/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"comments":"The Prim.Symbol module is embedded in the PureScript compiler. Unlike `Prim`, it is not imported implicitly. It contains automatically solved type classes for working with `Symbols`.","declarations":[{"children":[],"comments":"Compiler solved type class for appending `Symbol`s together.\n","info":{"arguments":[["left",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],["right",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],["appended",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}]],"declType":"typeClass","fundeps":[[["left","right"],["appended"]],[["right","appended"],["left"]],[["appended","left"],["right"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Append"},{"children":[],"comments":"Compiler solved type class for comparing two `Symbol`s.\nProduces an `Ordering`.\n","info":{"arguments":[["left",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],["right",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],["ordering",{"annotation":[],"contents":[["Prim","Ordering"],"Ordering"],"tag":"TypeConstructor"}]],"declType":"typeClass","fundeps":[[["left","right"],["ordering"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Compare"},{"children":[],"comments":"Compiler solved type class for either splitting up a symbol into its\nhead and tail or for combining a head and tail into a new symbol.\nRequires the head to be a single character and the combined string\ncannot be empty.\n","info":{"arguments":[["head",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],["tail",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}],["symbol",{"annotation":[],"contents":[["Prim"],"Symbol"],"tag":"TypeConstructor"}]],"declType":"typeClass","fundeps":[[["head","tail"],["symbol"]],[["symbol"],["head","tail"]]],"superclasses":[]},"kind":null,"sourceSpan":null,"title":"Cons"}],"name":"Prim.Symbol","reExports":[]}
Loading