I have done it myself but when I didn't really know better. There are a variety of reasons you shouldn't and an answer that you could.
aqadvisor has a stocking calculator. It is possible it will help you with temps for the other fish.
As mentioned GF will get VERY large, and in most tanks, like a community tank do not have the right conditions to grow like they should.
This is a thread which is quite eye opening about the size a GF can get when well cared for.
A possibility would be to stock fish of size which may or may not be eaten by an indiscriminate GF, which enjoy lower temp water.
10 times size of tank for the gallon per hour size filter 40G would need to be around 400+G p/h as it is tested at the optimum with brand new filter pad and clean water. So after the filter works for awhile, it's gph
Excellent media selections, and top notch attention to pwc
, probably 2x per week.
Platy and White Cloud Mountain Minnows will be alright initially but could be eaten because they will end up smaller than the GF mouth size, but are pretty fast.
Then the other issue is food competition.
Some fancies like Lions Head and telescoping eyes should only be kept with similar eating ability fish or they will not get the food they need.
That is just some of the things to know off the top of my head.
There is a bunch more information for GF topics at this section
Freshwater & Brackish - Coldwater, Native Fish & Ponds - Aquarium Advice - Aquarium Forum Community