mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
changes parsing rules around empty extensions
This commit is contained in:
@@ -79,10 +79,11 @@ instance KnownSymbol a => Show (Extension a) where
|
|||||||
show e@(Extension file) = file <.> extension e
|
show e@(Extension file) = file <.> extension e
|
||||||
|
|
||||||
instance KnownSymbol a => Read (Extension a) where
|
instance KnownSymbol a => Read (Extension a) where
|
||||||
readsPrec _ s = [(Extension fileName, "") | ("" <.> fileExt) == ("" <.> ext')]
|
readsPrec _ s = case (symbolVal $ Proxy @a) of
|
||||||
|
"" -> [(Extension s, "")]
|
||||||
|
other -> [(Extension file, "") | ext' == "" <.> other]
|
||||||
where
|
where
|
||||||
(fileName, fileExt) = splitExtension s
|
(file, ext') = splitExtension s
|
||||||
ext' = extension (def :: Extension a)
|
|
||||||
|
|
||||||
withPeriod :: String -> String
|
withPeriod :: String -> String
|
||||||
withPeriod word@(a:_) = case a of
|
withPeriod word@(a:_) = case a of
|
||||||
|
|||||||
Reference in New Issue
Block a user