I'm playing with Haskell's list comprehensions, tuples, and
The exercise I've given myself is to find all triangles with a perimeter of length 26 in the set of triangles whose edges range from 1 to 10 in length.
main = do print triangles triangles = [(a,b,c) | a <- [1..10], b <- [1..10], c <- [1..10], hasPerimeterOf 26 (a,b,c)] -- Determines whether a triangle has a perimeter of targetPerimeter hasPerimeterOf targetPerimeter triangle = targetPerimeter == perimeter triangle -- Calculates the perimeter of a triangle perimeter triangle = foldr (+) 0 (toList(triangle)) -- Converts a tuple of three to a list toList (a,b,c) = a : b : c : 
Is there a nicer way to convert a homogenous tuple to a list?
Generally, are there ways to simplify this code?