1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 17:05:33 +03:00
Commit Graph

5715 Commits

Author SHA1 Message Date
Rob Rix
c877cdf0d2 s/MaybeBoth/BothMaybe. 2016-03-14 14:13:46 -04:00
Rob Rix
bf74097847 Add a bothWithDefault function to convert MaybeBoth back into Both. 2016-03-14 14:11:01 -04:00
Rob Rix
d78d15c578 Add a Coalescent instance over Maybe. 2016-03-14 12:29:21 -04:00
Rob Rix
6231024f38 Simplify Identity’s Coalescent instance. 2016-03-14 12:29:11 -04:00
Rob Rix
fdf91d4f2a Add an Align instance for Adjoined. 2016-03-14 09:37:54 -04:00
Rob Rix
7a2d331f40 Document snoc. 2016-03-14 09:26:42 -04:00
Rob Rix
ce912716ea Document cons. 2016-03-14 09:26:39 -04:00
Rob Rix
7f74d0dc2e Add snoc to construct Adjoined rightwards. 2016-03-14 09:25:59 -04:00
Rob Rix
6db4b1ce7a Add cons to construct Adjoined leftwards. 2016-03-14 09:25:48 -04:00
Rob Rix
096680b668 Document uncons/unsnoc. 2016-03-14 09:17:26 -04:00
Rob Rix
564128a80a Document fromList. 2016-03-14 09:17:19 -04:00
Rob Rix
db103aea51 Rewrite the Monoid instance using the uncons/unsnoc functions. 2016-03-11 18:43:28 -05:00
Rob Rix
115549407c Add an unsnoc function to unpack the right side of an Adjoined. 2016-03-11 18:40:45 -05:00
Rob Rix
004236acdb Add an uncons function to unpack the left side of an Adjoined. 2016-03-11 18:40:32 -05:00
Rob Rix
cf63f4b222 Split the guards across multiple lines. 2016-03-11 17:46:25 -05:00
Rob Rix
c0b9e66981 Document justBoth. 2016-03-11 16:59:34 -05:00
Rob Rix
a6d2892a31 Add a justBoth function to lift Both a into MaybeBoth a. 2016-03-11 16:58:53 -05:00
Rob Rix
62c1798bf5 Document maybeBothOfThese. 2016-03-11 16:57:32 -05:00
Rob Rix
8b51fe7771 MaybeBoth is Coalescent. 2016-03-11 16:49:29 -05:00
Rob Rix
f8afe6208a MaybeBoth is a Crosswalk. 2016-03-11 16:49:24 -05:00
Rob Rix
eaf8228932 MaybeBoth is Applicative. 2016-03-11 16:48:54 -05:00
Rob Rix
15cfd88fb5 Add maybeBothOfThese to construct Both (Maybe a) from These a a. 2016-03-11 16:48:33 -05:00
Rob Rix
95b229ad20 Add a newtype wrapper around Both (Maybe a). 2016-03-11 16:48:12 -05:00
Rob Rix
859dd44fa0 Revert "🔥 bothOfThese."
This reverts commit 0c31bffad138ea4b9b5017ea0ed7f3384fcc4771.
2016-03-11 15:22:30 -05:00
Rob Rix
c6568f0b43 Revert "🔥 a redundant import."
This reverts commit e8b9b70289c72dc9f23f4afc1139130dc60b57ca.
2016-03-11 15:22:26 -05:00
Rob Rix
842af743e7 Document Adjoined. 2016-03-11 14:25:53 -05:00
Rob Rix
fa8f9c15b0 🔥 Both.zip & Both.zipWith. 2016-03-11 14:21:24 -05:00
Rob Rix
2df34adef6 GeneralizedNewtypeDeriving on Data.Functor.Both. 2016-03-11 14:03:56 -05:00
Rob Rix
49578b9fd7 GeneralizedNewtypeDeriving on Data.Adjoined. 2016-03-11 14:03:50 -05:00
Rob Rix
a55154c33f Document crosswalk and sequenceL. 2016-03-11 13:21:47 -05:00
Rob Rix
7dadd53445 Document Crosswalk. 2016-03-11 13:19:17 -05:00
Rob Rix
283b906cef Document align/alignWith. 2016-03-11 13:15:08 -05:00
Rob Rix
e3eab9df57 Document nil. 2016-03-11 13:12:30 -05:00
Rob Rix
81ef7742c7 Document the cases of the Align instance for []. 2016-03-11 13:09:44 -05:00
Rob Rix
0f2c693294 Use splitAt to bind & clarify the roles of the portions of bs. 2016-03-11 13:08:21 -05:00
Rob Rix
1ecff8e9b1 Zip the remainder into These directly. 2016-03-11 12:53:05 -05:00
Rob Rix
e0e3277ccc Document Align. 2016-03-11 12:40:13 -05:00
Rob Rix
233c7bc13f 🔥 a redundant import. 2016-03-11 01:14:31 -05:00
Rob Rix
cd844d7a00 🔥 zipDefaults. 2016-03-11 01:06:09 -05:00
Rob Rix
693f91b93c 🔥 bothOfThese. 2016-03-11 01:05:54 -05:00
Rob Rix
37865cc509 The Align instance for List pads from the start. 2016-03-10 20:05:46 -05:00
Rob Rix
2c8f16403d bothOfThese takes Both defaults. 2016-03-10 14:55:03 -05:00
Rob Rix
1694caa289 Document bothOfThese. 2016-03-10 14:00:35 -05:00
Rob Rix
d230f4c406 Add an instance of Crosswalk for Maybe. 2016-03-10 14:00:27 -05:00
Rob Rix
b8d2d54e30 Add an instance of Align for Maybe. 2016-03-10 14:00:14 -05:00
Rob Rix
998a7f9543 Revert "Remove the default implementation for alignWith."
This reverts commit 3edafd3fb2c75c3664bbd05dc06dbcf601f8748c.
2016-03-10 13:47:02 -05:00
Rob Rix
a65798b0dc Add a function to construct Both from These & a default value. 2016-03-10 13:34:13 -05:00
Rob Rix
35024d02cf Add a default implementation for crosswalk. 2016-03-10 13:15:48 -05:00
Rob Rix
64baf04a31 Crosswalks imply Functors. 2016-03-10 13:15:39 -05:00
Rob Rix
d792ddcd57 Define these for case analysis over These. 2016-03-10 13:14:29 -05:00
Rob Rix
912823b2cd Don’t override sequenceL for Identity. 2016-03-10 12:54:26 -05:00
Rob Rix
2cd47afafd Supply a default implementation of sequenceL. 2016-03-10 12:54:17 -05:00
Rob Rix
05d5d69cfc Crosswalk has a crosswalk method.
The relationship between crosswalk and sequenceL is essentially the
same as the relationship between traverse and sequenceA.
2016-03-10 12:54:09 -05:00
Rob Rix
efa88249d0 Add an instance of Crosswalk for Identity. 2016-03-10 12:49:52 -05:00
Rob Rix
86dc5ad6f5 Add a Crosswalk typeclass. 2016-03-10 12:48:09 -05:00
Rob Rix
1906f84dad 🔥 a redundant import. 2016-03-10 12:30:06 -05:00
Rob Rix
612169a6c6 🔥 transpose. 2016-03-10 12:29:18 -05:00
Rob Rix
f7abf91678 Remove the default implementation for alignWith. 2016-03-10 10:48:35 -05:00
Rob Rix
3613edf521 Revert "Revert "Eta-reduce align.""
This reverts commit 5e43f381a2479b3a63353aac2d34178210175bfd.
2016-03-10 10:47:16 -05:00
Rob Rix
a8f8039a5c Revert "Revert "Align depends on These.""
This reverts commit 6e4bfc96a0c6aa288e1f32ca40636e0f2edb94e1.
2016-03-10 10:47:04 -05:00
Rob Rix
a335530fdb Revert "Revert "Add an Align instance for lists.""
This reverts commit b6fc6e4ffd2dbac921c971753e1dd76d1f36cffd.
2016-03-10 10:46:58 -05:00
Rob Rix
9d1756e666 Revert "Revert "Add an Align typeclass.""
This reverts commit be536afec277f39dad7a1002fb40823b137045c5.
2016-03-10 10:46:55 -05:00
Rob Rix
9e70dec853 Revert "Revert "These is an instance of Bifunctor.""
This reverts commit 685e672f79b504963bd53b206fd91e330bcb8875.
2016-03-10 10:46:48 -05:00
Rob Rix
c23ecea3ba Revert "Revert "Add the These type.""
This reverts commit 502ab42e9b049f6f5e601f759620d274885a44db.
2016-03-10 10:46:45 -05:00
Rob Rix
b6d422eb5b Revert "Revert "Stub in a Data.Bifunctor.These module.""
This reverts commit 2b5c242f70e141e00fdeadd378c2d6eae49fce22.
2016-03-10 10:46:32 -05:00
Rob Rix
ddd0adf2aa Revert "Revert "Stub in a Data.Align module.""
This reverts commit 91ab52cef2217ae1a92eebb4d7d90bbcc1626565.
2016-03-10 10:45:29 -05:00
Rob Rix
7a0b948338 coalesce distributes through Identity. 2016-03-10 10:00:29 -05:00
Rob Rix
ff8bd646e4 🔥 the Coalesce type synonym. 2016-03-10 09:53:12 -05:00
Rob Rix
7161658393 🔥 mappendBy. 2016-03-10 09:53:00 -05:00
Rob Rix
f3223c1336 🔥 the empty value. 2016-03-10 09:51:38 -05:00
Rob Rix
bf74a6a6f6 Add a Monoid instance for Adjoined over Coalescent types. 2016-03-10 09:51:29 -05:00
Rob Rix
7fd23f6f29 Document coalesce. 2016-03-10 09:44:43 -05:00
Rob Rix
a300415e58 Document Coalescent. 2016-03-10 09:43:47 -05:00
Rob Rix
1179893979 Add a Coalescent typeclass. 2016-03-10 09:42:47 -05:00
Rob Rix
7c88d9ff38 Stub in a Data.Coalescent module. 2016-03-10 09:41:57 -05:00
Rob Rix
e85572be38 Define the empty Adjoined. 2016-03-10 08:34:23 -05:00
Rob Rix
89104cb834 Add fromList for Adjoined. 2016-03-10 03:40:59 -05:00
Rob Rix
4153844024 Disambiguate fromList. 2016-03-10 03:40:54 -05:00
Rob Rix
abc8146c31 Simplify the other cases. 2016-03-10 03:33:43 -05:00
Rob Rix
bb63380905 Coalesce functions return a list. 2016-03-10 03:32:25 -05:00
Rob Rix
a9399ae818 🔥 PartialSemigroup. 2016-03-10 03:31:28 -05:00
Rob Rix
29064a6d9d Revert "🔥 Data.Adjoined."
This reverts commit 68dd849071a17f58d4bfe83ebc05b55ffc011ba5.
2016-03-10 03:27:00 -05:00
Rob Rix
683fc20989 Replace zipWithDefaults with zipDefaults. 2016-03-09 02:08:22 -05:00
Rob Rix
1d99e4f548 🔥 Data.Adjoined. 2016-03-08 10:24:27 -05:00
Rob Rix
5e32c041fb 🔥 the PartialSemigroup/coalesceBy stuff for Both. 2016-03-08 10:24:20 -05:00
Rob Rix
6dfb8524ff Generalize coalesceBy to Both (Coalesce a). 2016-03-07 14:32:31 -05:00
Rob Rix
767a9e93fc Add a Coalesce type synonym. 2016-03-07 14:29:06 -05:00
Rob Rix
8595496032 Extract a coalesceBy function taking a coalesce function. 2016-03-07 14:28:17 -05:00
Rob Rix
76ea86d0f4 Extract a mappendBy function taking a coalesce function. 2016-03-07 14:25:23 -05:00
Rob Rix
14ce322cff Both is a PartialSemigroup under a PartialSemigroup which is also a Monoid. 2016-03-07 12:58:15 -05:00
Rob Rix
6bd58e3007 Revert "Stub in a Data.Bifunctor.These module."
This reverts commit 2cb0cce8304de64ebca4b8106dc453bd66fe1c36.
2016-03-07 12:57:12 -05:00
Rob Rix
95de4b23d6 Revert "Add the These type."
This reverts commit 23c0bf34584d3ef626081001e8762f4a98ea706e.
2016-03-07 12:57:09 -05:00
Rob Rix
6fbafa268d Revert "These is an instance of Bifunctor."
This reverts commit e299633535e46af5ca0a6334cdc3891d18fb76b4.
2016-03-07 12:57:06 -05:00
Rob Rix
705b0757ed Revert "Stub in a Data.Align module."
This reverts commit 7e2a1740f7c585cc1ac277c1cd92b333c7c68e34.
2016-03-07 12:57:03 -05:00
Rob Rix
1dfcf8e783 Revert "Add an Align typeclass."
This reverts commit b5e07c617dded12b6cca0e31664c0b12c679da11.
2016-03-07 12:57:00 -05:00
Rob Rix
2b5bd9ea84 Revert "Add an Align instance for lists."
This reverts commit d23ee2e7b622f7310fe80ab571c140dfcf09bc92.
2016-03-07 12:56:58 -05:00
Rob Rix
925a4b9ecf Revert "Align depends on These."
This reverts commit d625441bd8a3e6cbdce561499e4d41c078ebb261.
2016-03-07 12:56:55 -05:00
Rob Rix
cd0a65236a Revert "Eta-reduce align."
This reverts commit be2bea951b9e94567537dc4d5c0d9aa7e8e08d4b.
2016-03-07 12:56:44 -05:00
Rob Rix
7e945dcad2 Eta-reduce align. 2016-03-07 11:19:53 -05:00
Rob Rix
e6a0c8358d Align depends on These. 2016-03-07 09:44:53 -05:00
Rob Rix
63782505af Add an Align instance for lists. 2016-03-07 09:42:53 -05:00
Rob Rix
05fa8a6aa5 Add an Align typeclass. 2016-03-07 09:38:13 -05:00
Rob Rix
fb24cc7241 Stub in a Data.Align module. 2016-03-07 09:33:09 -05:00
Rob Rix
25e7dbdbe4 These is an instance of Bifunctor. 2016-03-07 09:31:01 -05:00
Rob Rix
3a38edefd9 Add the These type. 2016-03-07 09:28:47 -05:00
Rob Rix
d78b5e7a7a Stub in a Data.Bifunctor.These module. 2016-03-07 09:28:09 -05:00
Rob Rix
63802d3137 Maybe is a PartialSemigroup under a Monoid. 2016-03-05 01:00:11 -05:00
Rob Rix
4deabf496f Implement Adjoined over Seq. 2016-03-05 00:57:26 -05:00
Rob Rix
ae64b6f930 Define Adjoined over a list. 2016-03-05 00:43:07 -05:00
Rob Rix
afffe77c1d Represent Empty via Maybe. 2016-03-05 00:14:19 -05:00
Rob Rix
4b2c548d32 Defined Adjoined as a binary tree-ish thing. 2016-03-05 00:09:18 -05:00
Rob Rix
b251f1c67d Define Adjoined as an ad hoc list-ish tree thing. 2016-03-04 23:43:33 -05:00
Rob Rix
dc8b7afc02 Document partial semigroups. 2016-03-04 22:51:24 -05:00
Rob Rix
2b90836bc8 Add a PartialSemigroup instance over Bool. 2016-03-04 22:47:47 -05:00
Rob Rix
2495305197 We no longer need Flexible or Undecidable instances. 2016-03-04 22:40:20 -05:00
Rob Rix
e5532f71b6 🔥 the Monoid a => PartialSemigroup a instance. 2016-03-04 22:39:49 -05:00
Rob Rix
d54324e20c Add a Monoid instance for Adjoined over partial semigroups. 2016-03-04 22:25:27 -05:00
Rob Rix
42579d9c5b Add a Monad instance for Adjoined. 2016-03-04 22:25:16 -05:00
Rob Rix
d1a2d564bf Add an Applicative instance for Adjoined. 2016-03-04 22:24:50 -05:00
Rob Rix
e6a8d061e5 Monoids induce partial semigroups. 2016-03-04 22:13:15 -05:00
Rob Rix
96d42bd962 Adjoined wraps Maybe. 2016-03-04 22:11:23 -05:00
Rob Rix
9ecfdf3bfb Replace Adjoining with PartialSemigroup. 2016-03-04 22:08:56 -05:00
Rob Rix
00057c01fa Add an Adjoining typeclass. 2016-03-04 22:02:35 -05:00
Rob Rix
354c137176 Derive some reasonable default instances. 2016-03-04 21:58:24 -05:00
Rob Rix
62b255639f Stub in an Adjoined type. 2016-03-04 21:57:35 -05:00
Rob Rix
2dde65d46e Stub in a Data.Adjoined module. 2016-03-04 21:56:41 -05:00
Rob Rix
d702926228 Document maybeConcat. 2016-03-04 20:08:56 -05:00
Rob Rix
d6ec8d0d8c Generalize maybeUnionRanges to maybeConcat. 2016-03-04 20:06:32 -05:00
Rob Rix
4837a5e2fb Merge branch 'moved-terms-in-keyed-nodes-shouldn’t-crash' into refactor-alignment
# Conflicts:
#	src/Alignment.hs
2016-03-03 11:05:30 -05:00
Rob Rix
9fa5334e33 Document transpose. 2016-03-03 10:37:55 -05:00
Rob Rix
0b4028e628 Document Copointed. 2016-03-02 23:24:22 -05:00
Rob Rix
49eb9c1e4f Add a Copointed instance for Identity. 2016-03-02 23:20:54 -05:00
Rob Rix
85f50691b5 Add a Copointed instance for (a, _). 2016-03-02 23:20:14 -05:00
Rob Rix
9182ac04ca Merge branch 'moved-terms-in-keyed-nodes-shouldn’t-crash' into copointed 2016-03-02 23:18:52 -05:00
Rob Rix
f4f0c44b6a Add a Copointed typeclass. 2016-03-02 23:09:44 -05:00
Rob Rix
a8ca94bd49 Stub in a Data.Copointed module. 2016-03-02 23:08:28 -05:00
Rob Rix
c10a44e089 Add a transpose operation over Both. 2016-03-02 18:23:59 -05:00
Rob Rix
051c4f5530 Derive an Ord instance over Both. 2016-03-02 14:31:40 -05:00
Rob Rix
53b792e8b4 Sort the derived instances over Both. 2016-03-02 14:31:40 -05:00
Rob Rix
ae149c94ff Use runBothWith to tidy up a few computations. 2016-02-29 19:43:57 -05:00
Rob Rix
51ad3ba049 Add runBothWith. 2016-02-29 19:41:05 -05:00
Rob Rix
7548e148dc Rename runLeft/runRight to fst/snd. 2016-02-29 19:39:04 -05:00
Rob Rix
3e172365a2 Map directly over the applicatives. 2016-02-29 13:50:51 -05:00
Rob Rix
5b5f22711a Define zipWithDefaults over Both. 2016-02-29 10:57:01 -05:00
Rob Rix
acca5d8917 Add runLeft/runRight conveniences. 2016-02-29 09:33:38 -05:00
Rob Rix
acd19b4502 Don’t bind variables we don’t use. 2016-02-29 09:33:02 -05:00
Rob Rix
e26b4bacd5 Document Both. 2016-02-29 09:15:26 -05:00
Rob Rix
cff2511305 Implement zipWith over Both. 2016-02-29 01:54:35 -05:00
Rob Rix
3296276f90 Implement zip over Both. 2016-02-29 01:51:37 -05:00
Rob Rix
ecdb3c3e9b Implement unzip over Both. 2016-02-29 01:46:43 -05:00
Rob Rix
b6ffeeba2a Document both. 2016-02-29 01:31:45 -05:00
Rob Rix
391d102dcf Add a both function. 2016-02-29 01:31:04 -05:00
Rob Rix
0626228917 Data.Bifunctor.Join is actually Data.Functor.Both. 2016-02-28 21:29:59 -05:00
Rob Rix
e33014ef27 Add a Monoid instance for Join. 2016-02-28 21:18:03 -05:00
Rob Rix
ad9e24da57 Add an eliminator for Option. 2016-02-26 19:54:38 -05:00
Rob Rix
6f13e62eb9 Add an Option type. 2016-02-26 19:54:33 -05:00
Rob Rix
c0874465ee Stub in a Data.Option module. 2016-02-26 19:46:57 -05:00
Rob Rix
509ddedf7b Add an Applicative instance. 2016-02-26 18:56:44 -05:00
Rob Rix
e684031097 Derive Eq, Show, Functor, Foldable, and Traversable instances. 2016-02-26 18:56:39 -05:00
Rob Rix
bb707cffc1 Add a Join type specialized to pairs. 2016-02-26 18:56:26 -05:00
Rob Rix
6b35f029af Stub in a Data.Bifunctor.Join module. 2016-02-26 18:56:16 -05:00
Matt Diephouse
e7fe0d6f97 Document OrderedMap.hs 2016-02-02 15:33:08 -05:00
Matt Diephouse
7d7ee80b20 notElem is a thing 2016-02-02 15:30:44 -05:00
Matt Diephouse
b5315ce571 Implement union in terms of difference 2016-02-02 15:30:36 -05:00
Rob Rix
7af5a4876a Move OrderedMap into Data. 2016-01-06 11:56:58 -05:00