- If your editor doesn't show the tooltips, completions, and doesn't output any error, close your editor (VSCode or Atom) and then delete the 
.psc-ide-portfile in your project folder. More info about this here : nwolverson/atom-ide-purescript#196 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import { ChangeEventHandler, useCallback, useRef } from "react"; | |
| const ReadFile = () => { | |
| const fileReader = useRef<FileReader | null>(null); | |
| const parseFile = useCallback((fileContentStr: string) => { | |
| // parse yo shit | |
| }, []); | |
| const handleFileRead = useCallback(() => { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | module Main where | |
| import Prelude | |
| import Control.Monad.Eff (Eff) | |
| import Control.Monad.Eff.Console (CONSOLE, logShow) | |
| type Point = { x :: Int, y :: Int } | |
| anotherPoint :: Point | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const Right = x => ({ | |
| chain: f => f(x), | |
| map: f => Right(f(x)), | |
| fold: (f, g) => g(x), | |
| inspect: () => `Right(${x})`, | |
| }); | |
| const Left = x => ({ | |
| chain: f => Left(x), | |
| map: f => Left(x), | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function chain (cb) { | |
| const previousTask = this | |
| const chainedTask = Task((resolve, reject) => { | |
| let nextCancelCb | |
| let previousCancel = previousTask.fork( | |
| reject, | |
| (val) => { | |
| try { | |
| let nextTask = cb(val) | |
| let nextCancel = nextTask.fork(reject, resolve) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const insertAtIndex = (arr, item, index) => arr.splice(index, 0, item); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | extension Optional { | |
| func cata<T>(onNothing: (Void -> T), _ onSome: ((Wrapped) -> T)) -> T { | |
| switch self { | |
| case .Some(let a): | |
| return onSome(a) | |
| case nil: | |
| return onNothing() | |
| } | |
| } | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | extension Optional { | |
| func cata<T>(onNothing: (Void -> T), _ onSome: ((Wrapped) -> T)) -> T { | |
| switch self { | |
| case .Some(let a): | |
| return onSome(a) | |
| case nil: | |
| return onNothing() | |
| } | |
| } | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const reducer = (f) => (acc, curr) => { | |
| if(Array.isArray(curr)) | |
| return acc.concat(f(curr)) | |
| acc.push(curr) | |
| return acc | |
| } | |
| const f = (arr) => arr.reduce(reducer(f), []) | 
NewerOlder