Skip to content

Commit

Permalink
Added a Media trait
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jun 27, 2024
1 parent 9e3f180 commit 070354a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/gesticulate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import language.dynamics
//import language.experimental.captureChecking

object Media:
given Text is Media = _ => MediaType(Group.Text, Subtype.Standard(t"plain"))

object Group:
given Debug[Group] = _.name
given Group is Showable = _.name.lower
Expand Down Expand Up @@ -158,6 +160,10 @@ object Media:
final private val specials: Set[Char] =
Set('(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '+')

trait Media:
type Self
extension (value: Self) def mediaType: MediaType

object MediaTypeError:
enum Nature:
case NotOneSlash, MissingParam, InvalidGroup
Expand Down

0 comments on commit 070354a

Please sign in to comment.