소스 검색

Remove partial constraint on toOutput

jherve 1 년 전
부모
커밋
01f7f371a1
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 2
      src/Content.purs
  2. 5 2
      src/LinkedIn/Output.purs

+ 1 - 2
src/Content.purs

@@ -13,7 +13,6 @@ import LinkedIn.Page.JobOffer (JobOfferPage)
 import LinkedIn.Page.Projects (ProjectsPage)
 import LinkedIn.Page.Skills (SkillsPage)
 import LinkedIn.Page.WorkExperiences (WorkExperiencesPage)
-import Partial.Unsafe (unsafePartial)
 import Type.Proxy (Proxy(..))
 
 main :: Effect Unit
@@ -33,4 +32,4 @@ main = do
 
   case ctx of
     Left l -> logShow l
-    Right r -> unsafePartial $ toOutput r dom >>= logShow
+    Right r -> toOutput r dom >>= logShow

+ 5 - 2
src/LinkedIn/Output.purs

@@ -1,6 +1,8 @@
 module LinkedIn.Output where
 
-import Data.Either (Either)
+import Prelude
+
+import Data.Either (Either(..))
 import Effect (Effect)
 import LinkedIn (run)
 import LinkedIn.Output.Types (Output)
@@ -12,9 +14,10 @@ import LinkedIn.PageUrl (PageUrl(..))
 import Type.Proxy (Proxy(..))
 import Web.DOM (Document)
 
-toOutput ∷ Partial ⇒ PageUrl → Document → Effect (Either String Output)
+toOutput ∷ PageUrl → Document → Effect (Either String Output)
 toOutput ctx dom = case ctx of
   UrlProjects _ -> run (Proxy :: Proxy ProjectsPage) dom
   UrlSkills _ -> run (Proxy :: Proxy SkillsPage) dom
   UrlWorkExperience _ -> run (Proxy :: Proxy WorkExperiencesPage) dom
   UrlJobOffer _ -> run (Proxy :: Proxy JobOfferPage) dom
+  _ -> pure $ Left "Not handled yet"