packages feed

haskell-language-server-2.7.0.0: plugins/hls-explicit-record-fields-plugin/test/testdata/HsExpanded1.hs

{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE NamedFieldPuns #-}

module HsExpanded1 where
import Prelude

ifThenElse :: Int -> Int -> Int ->  Int
ifThenElse x y z = x + y + z

data MyRec = MyRec
  { foo :: Int }

myRecExample = MyRec 5

convertMe :: Int
convertMe =
  if (let MyRec {..} = myRecExample
      in foo) then 1 else 2