-- http://www.codewars.com/kata/5541f58a944b85ce6d00006a
module Codewars.Kata.Fib where

productFib :: Integer -> (Integer, Integer, Bool)
productFib n = wrap . head . dropWhile ((< n) . uncurry (*)) $ fibs where
  fib  = 1 : 1 : zipWith (+) fib (tail fib)
  fibs = zip fib (tail fib)
  wrap (a, b) = (a, b, a * b == n)
  