statebox / cql

CQL: Categorical Query Language implementation in Haskell
GNU Affero General Public License v3.0
163 stars 15 forks source link

Simplify qualified types #96

Closed wisnesky closed 5 years ago

wisnesky commented 5 years ago

The qualified types in the codebase are pretty verbose. To simplify, we could combine Show, Ord and Typable:

Show x, Ord x, Typeable x => AqlType x

And even do collections e.g.,

AqlType var, AqlType ty, ... => AqlType7 var ty sum en fk att gen sk

epost commented 5 years ago

ConstraintKinds might help here, see e.g. http://downloads.haskell.org/~ghc/7.4.1/docs/html/users_guide/constraint-kind.html.

wisnesky commented 5 years ago

Let’s do this:

class (Ord t, Show t, Typeable) t => Nice t where

And then replace things like

(Ord t, Show t, Typeable t, …) =>

With

(Nice t, …) =>

We can even have

Nice2 t t’ Nice3 t t’ t’’ ...

And so forth.

Will this work? If so, are there volunteers?

On Oct 24, 2018, at 8:12 AM, Erik Post notifications@github.com wrote:

ConstraintKinds might help here, see e.g. http://downloads.haskell.org/~ghc/7.4.1/docs/html/users_guide/constraint-kind.html.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

wisnesky commented 5 years ago

We should add NFData: https://downloads.haskell.org/~ghc/7.4.1/docs/html/libraries/deepseq-1.3.0.0/Control-DeepSeq.html to 'Nice' as well, when the time is right, which will probably be soon, now that the timeout issue involves adding a new type class constraint everywhere