Commit Graph

15 Commits

Author SHA1 Message Date
Jan Hrček
3bd2235c0c Fix some hlint warnings 2022-09-24 12:56:11 +02:00
Jonathan Daugherty
6f1b62ae53 AttrName: remove IsString instance
This change is motivated by the API wart that results from the
overloading of both "<>" and string literals that resulted in code like
this:

  a :: AttrName
  a = "blah" <> "things"

While this worked to create an AttrName with two segments, it is far too
easy to read this as two strings concatenated. The overloading hides
what is really going on with the segments of the attribute name. The way
to write the above example after this change is:

  a :: AttrName
  a = attrName "blah" <> attrName "things"
2022-08-04 18:44:57 -07:00
Jonathan Daugherty
4ea1f65d86 Update demo programs for changes to EventM 2022-07-16 23:10:03 -07:00
Jonathan Daugherty
bd89f787d2 Support GHC 8.4 (fixes #162)
This change splits up Monoid instances into Monoid and Semigroup. It
also conditionally imports Data.Monoid on GHCs prior to 8.4.
2018-03-17 09:03:59 -07:00
Jonathan Daugherty
eef78a0a67 Support attribute modification with modifyDefAttr, rename setDefault to setDefaultAttr 2017-10-09 13:02:21 -07:00
Jonathan Daugherty
dbebb512e9 Add hyperlink combinator, update attribute demo 2017-10-06 13:27:41 -07:00
Jonathan Daugherty
d4cb0fa63b AttrDemo: typo 2017-10-06 13:26:36 -07:00
Jonathan Daugherty
54380351a3 Add hyperlink test to attribute demo 2017-10-06 13:05:24 -07:00
Jonathan Daugherty
fc8cfe3b4a Remove appLiftVtyEvent in favor of library event type BrickEvent
This change makes it possible for brick to extent the event space using
its own event notions in addition those provided by Vty and the
application itself. This means we no longer need the user to provide the
type and appLiftVtyEvent went away. This makes pattern-matching in event
handlers a little noisier with the benefit that we can now add events
like mouse clicks or drags to the event type.
2016-10-25 20:19:31 -07:00
Jonathan Daugherty
3081e7367d Replace "Name" type with custom name type variable everywhere
This experimental change makes it possible to:
* Avoid runtime errors due to name typos
* Achieve compile-time guarantees about name matching and usage
* Force widget functions to be name-agnostic by being polymorphic
  in their name type
* Clean up focus handling by making it possible to pattern-match
  on cursor location names

The change also made many types more heavyweight and in some cases
this is unpleasant when we don't want to have to care about names.
But in those cases we can just use 'n' or '()' depending on how
concrete we need to be.  I'm not yet sure how this is going to play
out in practice.
2016-03-04 14:42:49 -08:00
Jonathan Daugherty
35aa2ad8a4 Monster patch: move most data types to Brick.Types, remove IsString
instance for Widget

- This makes the module layout more predictable since Brick.Widgets.Core
  now (mostly) only contains widgets and widget transformations
- Utility functions closely related to types are now in Brick.Types
- Brick.Types.Internal contains types used internal by the renderer,
  some are re-exported by Brick.Types
2015-08-19 19:40:06 -07:00
Jonathan Daugherty
962e7c83df Rename appMakeVtyEvent to appLiftVtyEvent 2015-07-10 13:53:21 -07:00
Jonathan Daugherty
137e59f5bf AttrDemo: use explicit imports 2015-07-10 12:49:17 -07:00
Jonathan Daugherty
9601098d46 Add appStartEvent to support getting scroll requests on the first rendering of the app state before other events have arrived 2015-06-30 19:15:29 -07:00
Jonathan Daugherty
7aa4e264a4 Add attribute handling demo program 2015-06-28 22:40:25 -07:00