ku-fpg / hermit-shell

HERMIT with GHCi shell
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Consolidate duplicate commands, establish HERMIT.API.Prelude #28

Closed RyanGlScott closed 6 years ago

RyanGlScott commented 9 years ago

This is my attempt at doing some slight cleanup of the command situation in hermit-shell at the moment. This pull request does the following:

RyanGlScott commented 9 years ago

My concern with making the above commands fully polymorphic was allowing them to be used in places where they shouldn't be. For example, AFAICT in HERMIT, id can only be used with a RewriteT LCore or RewriteT LCoreTC, so I wanted to avoid a scenario in hermit-shell where the phantom type of Rewrite could be instantiated with a type that id wasn't meant to work with.

This might be excessively paranoid, though, since in practice most of these commands can only be used with one specific Shell combinator. I'd have to investigate to see if there are any specific ways to circumvent HERMIT's types using hermit-shell.

xich commented 9 years ago

The fact that id only works at those two types is considered a limitation of the current shell... allowing more things (especially the KURE combinators like id, any-td, >>>, <+, etc) to be polymorphic was (at least IMHO) a goal for the new shell.

The reason we overloaded so much in the old shell (having two lhs commands, for instance) was to mitigate this limitation that everything had to be monomorphic. Having a single polymorphic lhs would be much better!

So, I agree that the type class approach here matches the behavior of the old shell more accurately, which may be a thing you want right now as you test things, but that old behavior was not itself ideal.

RyanGlScott commented 9 years ago

Oh, that's definitely a compelling argument, then. I'll go ahead and purge those typeclasses.

RyanGlScott commented 6 years ago

Closing stale PR.