Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Guards and where #192

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from

Conversation

sumanthyedoti
Copy link

Guards

bmiTell bmi
  | bmi <= 18.5 = 'Underweight'
  | bmi <= 25.0 = 'Normal'
  | bmi <= 30.0 = 'Fatty'
  | otherwise   = 'Index overflow'

where

bmiTell weight height
  | bmi <= skinny = 'Underweight'
  | bmi <= normal = 'Normal'
  | bmi <= fat = 'Fatty'
  | otherwise   = 'Index overflow'
  where bmi = weight / height ^ 2
        skinny = 18.5
        normal = 25.0
        fat = 30.0


incAndSq x = sq (x + 1)
  where sq x = x * x

@sumanthyedoti sumanthyedoti changed the base branch from master to dev April 27, 2022 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant