Skip to content

Instantly share code, notes, and snippets.

@0rphee
Created July 8, 2022 00:27
Show Gist options
  • Save 0rphee/a76874d6b496c88f4d611fb093aa99f0 to your computer and use it in GitHub Desktop.
Save 0rphee/a76874d6b496c88f4d611fb093aa99f0 to your computer and use it in GitHub Desktop.
Helix code lens and code actions for Haskell
-- Follow instructions from (https://www.haskell.org/ghcup/) to install Haskell-Language-Server
-- Neither do code actions nor code lenses are available when selecting eligible code, while in other
-- editors they are available
-- More code actions are available in other editors
-- func xs = sum xs
-- func = sum
func :: (Foldable t, Num a)=> t a -> a
func xs = foldl (+) 0 xs
-- The type signature can be added in other editors through code lens
-- f :: Num a => a -> a -> a
f x y = x * y + 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment