mirror of
https://github.com/chrisdone/duet.git
synced 2025-01-08 06:53:22 +03:00
Fix warnings
This commit is contained in:
parent
f8cd1ad7be
commit
f9317b857c
@ -19,7 +19,8 @@ library
|
||||
text,
|
||||
edit-distance,
|
||||
deepseq,
|
||||
aeson
|
||||
aeson,
|
||||
syb
|
||||
if !impl(ghcjs)
|
||||
build-depends:
|
||||
monad-logger
|
||||
|
@ -48,6 +48,18 @@ data Binding t i l
|
||||
| ExplicitBinding (ExplicitlyTypedBinding t i l)
|
||||
deriving (Show, Generic, Data, Typeable)
|
||||
|
||||
bindingIdentifier :: Binding t i l -> i
|
||||
bindingIdentifier =
|
||||
\case
|
||||
ImplicitBinding i -> fst (implicitlyTypedBindingId i)
|
||||
ExplicitBinding i -> explicitlyTypedBindingId i
|
||||
|
||||
bindingAlternatives :: Binding t i l -> [Alternative t i l]
|
||||
bindingAlternatives =
|
||||
\case
|
||||
ImplicitBinding i -> implicitlyTypedBindingAlternatives i
|
||||
ExplicitBinding i -> explicitlyTypedBindingAlternatives i
|
||||
|
||||
declLabel :: Decl t i l -> l
|
||||
declLabel =
|
||||
\case
|
||||
|
@ -10,7 +10,6 @@ import Control.Monad.Trans
|
||||
import Data.Char
|
||||
import Data.Generics (listify, everything, mkQ, extQ)
|
||||
import Data.Maybe
|
||||
import Debug.Trace
|
||||
import Duet.IDE.Constructors
|
||||
import Duet.IDE.Types
|
||||
import Duet.Types
|
||||
@ -272,13 +271,13 @@ interpretBackspace cursor ast = do
|
||||
_ -> pure e)
|
||||
NameNode (Identifier "_", _) -> do
|
||||
case findNodeParent (cursorUUID cursor) ast of
|
||||
Just (ExpressionNode LambdaExpression{}) -> put mparent
|
||||
_ -> put
|
||||
(do binding <- mparent
|
||||
trace (show binding) (return ())
|
||||
decl <- findNodeParent binding ast
|
||||
modul <- findNodeParent (nodeUUID decl) ast
|
||||
pure (nodeUUID modul))
|
||||
Just (ExpressionNode LambdaExpression {}) -> put mparent
|
||||
_ ->
|
||||
put
|
||||
(do binding <- mparent
|
||||
decl <- findNodeParent binding ast
|
||||
modul <- findNodeParent (nodeUUID decl) ast
|
||||
pure (nodeUUID modul))
|
||||
pure n
|
||||
NameNode (Identifier i, l) ->
|
||||
pure
|
||||
|
@ -48,7 +48,7 @@ main = do
|
||||
Right () -> pure ()
|
||||
Left msg ->
|
||||
Flux.pre_
|
||||
["className" Flux.@= "duet-error-msg"]
|
||||
["className" Flux.@= "duet-error-msg", "key" Flux.@= "error-msg"]
|
||||
(Flux.elemText (T.pack msg))
|
||||
renderModule (stateCursor state) (stateAST state)))
|
||||
()
|
||||
|
Loading…
Reference in New Issue
Block a user